Since Forecasts and Observations now can be a sub-group in a NetCDF file, these two functions need to be able to handle that situation.
A possible solution is to define a variable prefix.
# Check if Observations is the root group
# If it is the root group, no variable prefix is needed
# If it is not the root group, the variable prefix should be "Observations/"
#
var_prefix <- ''
if (any(grepl("^Observations", names(nc$var)))) {
var_prefix <- 'Observations/'
}
Since
Forecasts
andObservations
now can be a sub-group in a NetCDF file, these two functions need to be able to handle that situation.A possible solution is to define a variable prefix.