Load(): Bug when loading certain files with more than 1 grid
As reported by @rfernand , the following error message appears sometimes when using Load():
Error in if ((nlons == length(lon)) && (nlats == length(lat))) { : missing value where TRUE/FALSE needed
data <- Load('tos',
exp = list(list(path = '/esnas/exp/ecearth/i00k/monthly_mean/$VAR_NAME$_f3h/$VAR_NAME$_*_S$START_DATE$_*.nc')),
obs = NULL,
'19921101', output = 'lonlat')
* The load call you issued is:
* Load(var = "tos", exp = list(structure(list(path =
* "/esnas/exp/ecearth/i00k/monthly_mean/$VAR_NAME$_f3h/$VAR_NAME$_*_S$START_DATE$_*.nc"),
* .Names = "path")), obs = NULL, sdates = "19921101", grid =
* NULL, output = "lonlat", storefreq = "monthly", ...)
* See the full call in '$load_parameters' after Load() finishes.
* Fetching first experimental files to work out 'var_exp' size...
* Exploring dimensions...
* /esnas/exp/ecearth/i00k/monthly_mean/tos_f3h/tos_Omon_EC-EARTH_decadal_S19921101_r1i1p1_199211-199302.nc
Error in if ((nlons == length(lon)) && (nlats == length(lat))) { :
missing value where TRUE/FALSE needed
> data <- Load('tos', list(list(path = '/esnas/exp/ecearth/i00k/monthly_mean/$VAR_NAME$_f3h/$VAR_NAME$_*_S$START_DATE$_*.nc')), NULL, '19921101', output = 'lonlat', dimnames = list(lon = 'longitude', lat = 'latitude'))
* The load call you issued is:
* Load(var = "tos", exp = list(structure(list(path =
* "/esnas/exp/ecearth/i00k/monthly_mean/$VAR_NAME$_f3h/$VAR_NAME$_*_S$START_DATE$_*.nc"),
* .Names = "path")), obs = NULL, sdates = "19921101", grid =
* NULL, output = "lonlat", storefreq = "monthly", ...)
* See the full call in '$load_parameters' after Load() finishes.
* Fetching first experimental files to work out 'var_exp' size...
* Exploring dimensions...
* /esnas/exp/ecearth/i00k/monthly_mean/tos_f3h/tos_Omon_EC-EARTH_decadal_S19921101_r1i1p1_199211-199302.nc
Error in if ((nlons == length(lon)) && (nlats == length(lat))) { :
missing value where TRUE/FALSE needed
This is a bug in the code that happens when there are extra generic grids defined in the NetCDF files. I will fix and release soon.