cdo splitmon can not work correctly on the curvilinear grids?
Added by Ping Yang over 11 years ago
Hi CDO,
I used this code for split a yearly daily data into monthly daily data:
cdo splitmon, 10116_2011_tmin.nc ../month/10116_2011_tmin_"
However, the original file is a curvilinear grid which is lamber_conformal_conic projection:
short lambert_conformal_conic ;
lambert_conformal_conic:grid_mapping_name = "lambert_conformal_conic" ;
lambert_conformal_conic:longitude_of_central_meridian = -100. ;
lambert_conformal_conic:latitude_of_projection_origin = 42.5 ;
lambert_conformal_conic:false_easting = 0. ;
lambert_conformal_conic:false_northing = 0. ;
lambert_conformal_conic:standard_parallel = 25., 60. ;
and I found the two coordinate variables; projection_x_coordinate and projection_y_coordinate were missing.
I paste the original and splited file information(ncdump)
netcdf \10116_2011_tmin {
dimensions:
time = 365 ;
y = 127 ;
x = 68 ;
nv = 2 ;
variables:
float tmin(time, y, x) ;
tmin:_FillValue = -9999.f ;
tmin:cell_methods = "area: mean time: minimum" ;
tmin:coordinates = "lat lon" ;
tmin:grid_mapping = "lambert_conformal_conic" ;
tmin:long_name = "daily minimum temperature" ;
tmin:missing_value = -9999.f ;
tmin:units = "degrees C" ;
tmin:valid_range = -50.f, 50.f ;
short lambert_conformal_conic ;
lambert_conformal_conic:grid_mapping_name = "lambert_conformal_conic" ;
lambert_conformal_conic:longitude_of_central_meridian = -100. ;
lambert_conformal_conic:latitude_of_projection_origin = 42.5 ;
lambert_conformal_conic:false_easting = 0. ;
lambert_conformal_conic:false_northing = 0. ;
lambert_conformal_conic:standard_parallel = 25., 60. ;
double x ;
x:units = "m" ;
x:long_name = "x coordinate of projection" ;
x:standard_name = "projection_x_coordinate" ;
double y(y) ;
y:units = "m" ;
y:long_name = "y coordinate of projection" ;
y:standard_name = "projection_y_coordinate" ;
double time(time) ;
time:long_name = "time" ;
time:calendar = "standard" ;
time:units = "days since 1980-01-01 00:00:00 UTC" ;
time:bounds = "time_bnds" ;
double lat(y, x) ;
lat:units = "degrees_north" ;
lat:long_name = "latitude coordinate" ;
lat:standard_name = "latitude" ;
double lon(y, x) ;
lon:units = "degrees_east" ;
lon:long_name = "longitude coordinate" ;
lon:standard_name = "longitude" ;
short yearday(time) ;
yearday:long_name = "yearday" ;
yearday:valid_range = 1s, 365s ;
double time_bnds(time, nv) ;
and here is the monthly splited file information:
netcdf \10116_2011_tmin_12 {
dimensions:
x = 68 ;
y = 127 ;
time = UNLIMITED ; // (31 currently)
nb2 = 2 ;
variables:
double lon(y, x) ;
lon:standard_name = "longitude" ;
lon:long_name = "longitude coordinate" ;
lon:units = "degrees_east" ;
lon:_CoordinateAxisType = "Lon" ;
double lat(y, x) ;
lat:standard_name = "latitude" ;
lat:long_name = "latitude coordinate" ;
lat:units = "degrees_north" ;
lat:_CoordinateAxisType = "Lat" ;
double time(time) ;
time:standard_name = "time" ;
time:bounds = "time_bnds" ;
time:units = "days since 1980-01-01 00:00:00" ;
time:calendar = "standard" ;
double time_bnds(time, nb2) ;
time_bnds:units = "days since 1980-01-01 00:00:00" ;
time_bnds:calendar = "standard" ;
float tmin(time, y, x) ;
tmin:long_name = "daily minimum temperature" ;
tmin:units = "degrees C" ;
tmin:coordinates = "lon lat" ;
tmin:_FillValue = -9999.f ;
tmin:cell_methods = "area: mean time: minimum" ;
tmin:valid_range = -50.f, 50.f ;
short yearday(time) ;
yearday:long_name = "yearday" ;
yearday:valid_range = 1s, 365s ;
Is there a way in CDO or other tools that can perform this function without loosing these two variables?
Look forward to hearing from you
Ping
Replies (2)
RE: cdo splitmon can not work correctly on the curvilinear grids? - Added by Uwe Schulzweida over 11 years ago
Your data variable has coordinates on the original projection (lambert_conformal_conic) and the corresponding geographical coordinates (lat/lon). CDOs internal datamodel can handle only one set of coordinates for each variable. You can set the environment
IGNORE_ATT_COORDINATES=1
to ignore the coordinates attribute. In this case the projected coordinates are used in CDO and the coordinate variables lon and lat are ignored.
RE: cdo splitmon can not work correctly on the curvilinear grids? - Added by Ping Yang over 11 years ago
Hi Uwe,
I used the following command:
export IGNORE_ATT_COORDINATES=1 #for set the environment of IGNORE_ATT_COORDINATES=1
cdo -O splitmon 10302_2011_tmin.nc 10302_2011_tmin_
However, the result:
netcdf \10302_2011_tmin_01 {
dimensions:
x = 88 ;
y = 224 ;
time = UNLIMITED ; // (31 currently)
nb2 = 2 ;
variables:
double x ;
x:standard_name = "projection_x_coordinate" ;
x:long_name = "x coordinate of projection" ;
x:units = "m" ;
x:axis = "X" ;
double y(y) ;
y:standard_name = "projection_y_coordinate" ;
y:long_name = "y coordinate of projection" ;
y:units = "m" ;
y:axis = "Y" ;
char Lambert_Conformal ;
Lambert_Conformal:grid_mapping_name = "lambert_conformal_conic" ;
Lambert_Conformal:longitude_of_central_meridian = -100. ;
Lambert_Conformal:latitude_of_projection_origin = 42.5 ;
Lambert_Conformal:standard_parallel = 25., 60. ;
double time(time) ;
time:standard_name = "time" ;
time:bounds = "time_bnds" ;
time:units = "days since 1980-01-01 00:00:00" ;
time:calendar = "standard" ;
double time_bnds(time, nb2) ;
time_bnds:units = "days since 1980-01-01 00:00:00" ;
time_bnds:calendar = "standard" ;
short yearday(time) ;
yearday:long_name = "yearday" ;
yearday:valid_range = 1s, 365s ;
float tmin(time, y, x) ;
tmin:long_name = "daily minimum temperature" ;
tmin:units = "degrees C" ;
tmin:grid_type = "lcc2" ;
tmin:grid_mapping = "Lambert_Conformal" ;
tmin:_FillValue = -9999.f ;
tmin:valid_range = -50.f, 50.f ;
tmin:cell_methods = "area: mean time: minimum" ;
the original lat and lon variables are missing, I attached a sample file in this post, would you please help to let me know how to get correct results(keep both of the x,y and lon,lat)?
Thanks,
Ping
10302_2011_prcp.nc (27.8 MB) 10302_2011_prcp.nc |