Reads the full content of a NetCDF file, given only the file name

read_nc_onefile(
  filn,
  varnam = NA,
  date_origin = NA,
  time_is_years = FALSE,
  ignore_time = FALSE,
  check_flip = FALSE
)

Arguments

filn

A character string specifying the full path of the NetCDF file to be read.

varnam

A character string specifying the variable name of the NetCDF file. Can also be a vector of character strings. Defaults to NA, that is: all available variables are read.

date_origin

A character string of format "YYYY-MM-DD" specifying the origin, day 0, of the time values provided in the NetCDF file.

time_is_years

A logical specifying whether the values provided by dimension 'time' is years. Defaults to FALSE.

ignore_time

A logical specifying whether file has a time dimension Use this to ignore if it has a time dimension of length 1 by has_time=TRUE. Defaults to FALSE.

check_flip

A logical specifying whether order of latitude values should be checked.

Value

A list, containing "lon" (vector of longitudes of gridcell mid-points), "lat" (vector of latitudes of gridcell mid-points), "time" (vector of lubridate::ymd dates), "varnams" (a vector of all variable names as strings), and a named (nested) list of the data arrays (lon x lat x time) for each variable.