Merge two netCDF file without losing the rotated grid variables
Added by Kasra Keshavarz about 5 years ago
Hello,
I'm trying to extract a period of years from a netCDF file which its grid is rotated using the command below:
cdo selyear,1986/2005 inp1.nc 1986-2005_inp1.nc
However, the resulted netCDF lacks the rotated grid variables which is absurd. Would you please advise how it is possible to preserve the rotated grid variables after running the command above?
Regards,
Kasra
P.S. here is the ncdump -h of the original netCDF file:
netcdf prec.hist.CanESM2.CanRCM4.day.NAM-44.raw {
dimensions:
time = UNLIMITED ; // (20440 currently)
rlat = 130 ;
rlon = 155 ;
bnds = 2 ;
variables:
float prec(time, rlat, rlon) ;
prec:_FillValue = 1.e+20f ;
prec:cell_methods = "time:mean (interval:1200 seconds)" ;
prec:coordinates = "lon lat" ;
prec:grid_mapping = "rotated_pole" ;
prec:long_name = "Precipitation" ;
prec:standard_name = "lwe_precipitation_rate" ;
prec:units = "mm/day" ;
double time(time) ;
time:long_name = "time" ;
time:standard_name = "time" ;
time:units = "days since 1949-12-01" ;
time:axis = "T" ;
time:calendar = "365_day" ;
time:bounds = "time_bnds" ;
double time_bnds(time, bnds) ;
double rlon(rlon) ;
rlon:long_name = "longitude in rotated pole grid" ;
rlon:units = "degrees" ;
rlon:axis = "X" ;
rlon:standard_name = "grid_longitude" ;
double rlat(rlat) ;
rlat:long_name = "latitude in rotated pole grid" ;
rlat:units = "degrees" ;
rlat:axis = "Y" ;
rlat:standard_name = "grid_latitude" ;
double lon(rlat, rlon) ;
lon:long_name = "longitude" ;
lon:units = "degrees_east" ;
double lat(rlat, rlon) ;
lat:long_name = "latitude" ;
lat:units = "degrees_north" ;
char rotated_pole ;
rotated_pole:grid_mapping_name = "rotated_latitude_longitude" ;
rotated_pole:grid_north_pole_longitude = 83.f ;
rotated_pole:grid_north_pole_latitude = 42.5f ;
And, here is the ndump -h of the resulted netCDF file:
netcdf \1986-2005_prec.hist.CanESM2.CanRCM4.day.NAM-44.raw {
dimensions:
rlon = 155 ;
rlat = 130 ;
time = UNLIMITED ; // (7300 currently)
bnds = 2 ;
variables:
double lon(rlat, rlon) ;
lon:standard_name = "longitude" ;
lon:long_name = "longitude" ;
lon:units = "degrees_east" ;
lon:_CoordinateAxisType = "Lon" ;
double lat(rlat, rlon) ;
lat:standard_name = "latitude" ;
lat:long_name = "latitude" ;
lat:units = "degrees_north" ;
lat:_CoordinateAxisType = "Lat" ;
double time(time) ;
time:standard_name = "time" ;
time:long_name = "time" ;
time:bounds = "time_bnds" ;
time:units = "days since 1949-12-1 00:00:00" ;
time:calendar = "365_day" ;
time:axis = "T" ;
double time_bnds(time, bnds) ;
float prec(time, rlat, rlon) ;
prec:standard_name = "lwe_precipitation_rate" ;
prec:long_name = "Precipitation" ;
prec:units = "mm/day" ;
prec:coordinates = "lat lon" ;
prec:_FillValue = 1.e+20f ;
prec:missing_value = 1.e+20f ;
prec:cell_methods = "time:mean (interval:1200 seconds)" ;
Replies (2)
RE: Merge two netCDF file without losing the rotated grid variables - Added by Uwe Schulzweida about 5 years ago
You need to update your CDO installation, this problem is solved since ~2years.
RE: Merge two netCDF file without losing the rotated grid variables - Added by Kasra Keshavarz about 5 years ago
Thank you. Yes my version is 1.7.2 on a cluster that I use.