Project

General

Profile

CDo merge nc files

Added by Marston Ward over 12 years ago

I created a netcdf file using the lat and lon from another netcdf file that was created from a ECMWF grib file. All the meta data match: grid type: gaussian, array size, start and end points, but the two lat values differ by beyond the 4th decimal place. This is also true for the lon values and yet when I I merge the two files, CDO creates a lat_2 and lat but only 1 lon dimension. I want only 1 lat and lon dimension. Why does CDO do this?

ncdump -v lat merged.nc
netcdf merged {
dimensions:
lon = 320 ;
lat = 160 ;
lat_2 = 160 ;
time = UNLIMITED ; // (248 currently)
variables:
float lon(lon) ;
lon:long_name = "longiitude" ;
lon:units = "degrees_east" ;
lon:standard_name = "longitude" ;
lon:axis = "X" ;
float lat(lat) ;
lat:long_name = "latitude" ;
lat:units = "degrees_north" ;
lat:standard_name = "latitude" ;
lat:axis = "Y" ;
double lat_2(lat_2) ;
lat_2:long_name = "latitude" ;
lat_2:units = "degrees_north" ;
lat_2:standard_name = "latitude" ;
lat_2:axis = "Y" ;
double time(time) ;
time:units = "hours since 2006-01-01 03:00:00" ;
time:calendar = "proleptic_gregorian" ;
float TISR ;
TISR:long_name = "TOA incident solar radiation" ;
TISR:units = "W m**2" ;
TISR:code = 212 ;
TISR:grid_type = "gaussian" ;
TISR:_FillValue = -999.f ;
float TSR ;
TSR:long_name = "Top solar radiation" ;
TSR:units = "W m**-2 s" ;
TSR:code = 178 ;
TSR:table = 128 ;
TSR:grid_type = "gaussian" ;
float TSRC ;
TSRC:long_name = "Top net solar radiation, clear sky" ;
TSRC:units = "W m**-2" ;
TSRC:code = 208 ;
TSRC:table = 128 ;
TSRC:grid_type = "gaussian" ;

// global attributes:
:CDI = "Climate Data Interface version 1.5.0 (http://code.zmaw.de/projects/cdi)" ;
:Conventions = "CF-1.0" ;
:history = "Sun Apr 08 10:01:16 2012: cdo merge /nobackup/rossby15/sm_marst/T159L62/TISR_ECE2_200601.nc Xfilter.nc merged.nc\n",
"Sun Apr 08 09:59:37 2012: cdo -t ecmwf mulc,0.0000925925925925925 filter.nc Xfilter.nc\n",
"Sun Apr 08 09:59:36 2012: cdo -f nc -R -t ecmwf copy filter.out filter.nc" ;
:CDO = "Climate Data Operators version 1.5.0 (http://code.zmaw.de/projects/cdo)" ;
:institution = "ECMWF" ;
data:

lat = 89.14152, 88.02024, 86.89896, 85.77769, 84.65641, 83.53513, 82.41386, 
81.29258, 80.1713, 79.05003, 77.92875, 76.80747, 75.6862, 74.56492,
73.44364, 72.32236, 71.20109, 70.07981, 68.95853, 67.83726, 66.71598,
65.5947, 64.47343, 63.35215, 62.23087, 61.10959, 59.98832, 58.86704,
57.74576, 56.62449, 55.50321, 54.38193, 53.26065, 52.13938, 51.0181,
49.89682, 48.77555, 47.65427, 46.53299, 45.41172, 44.29044, 43.16916,
42.04789, 40.92661, 39.80533, 38.68406, 37.56278, 36.4415, 35.32022,
34.19895, 33.07767, 31.95639, 30.83512, 29.71384, 28.59256, 27.47128,
26.35001, 25.22873, 24.10745, 22.98618, 21.8649, 20.74362, 19.62235,
18.50107, 17.37979, 16.25852, 15.13724, 14.01596, 12.89468, 11.77341,
10.65213, 9.530854, 8.409577, 7.2883, 6.167023, 5.045746, 3.924469,
2.803192, 1.681915, 0.5606385, -0.5606385, -1.681915, -2.803192,
-3.924469, -5.045746, -6.167023, -7.2883, -8.409577, -9.530854,
-10.65213, -11.77341, -12.89468, -14.01596, -15.13724, -16.25852,
-17.37979, -18.50107, -19.62235, -20.74362, -21.8649, -22.98618,
-24.10745, -25.22873, -26.35001, -27.47128, -28.59256, -29.71384,
-30.83512, -31.95639, -33.07767, -34.19895, -35.32022, -36.4415,
-37.56278, -38.68406, -39.80533, -40.92661, -42.04789, -43.16916,
-44.29044, -45.41172, -46.53299, -47.65427, -48.77555, -49.89682,
-51.0181, -52.13938, -53.26065, -54.38193, -55.50321, -56.62449,
-57.74576, -58.86704, -59.98832, -61.10959, -62.23087, -63.35215,
-64.47343, -65.5947, -66.71598, -67.83726, -68.95853, -70.07981,
-71.20109, -72.32236, -73.44364, -74.56492, -75.6862, -76.80747,
-77.92875, -79.05003, -80.1713, -81.29258, -82.41386, -83.53513,
-84.65641, -85.77769, -86.89896, -88.02024, -89.14152 ;
}

[sm_marst@analys1 sw]$ ncdump -v lat_2 merged.nc
netcdf merged {
dimensions:
lon = 320 ;
lat = 160 ;
lat_2 = 160 ;
time = UNLIMITED ; // (248 currently)
variables:
float lon(lon) ;
lon:long_name = "longiitude" ;
lon:units = "degrees_east" ;
lon:standard_name = "longitude" ;
lon:axis = "X" ;
float lat(lat) ;
lat:long_name = "latitude" ;
lat:units = "degrees_north" ;
lat:standard_name = "latitude" ;
lat:axis = "Y" ;
double lat_2(lat_2) ;
lat_2:long_name = "latitude" ;
lat_2:units = "degrees_north" ;
lat_2:standard_name = "latitude" ;
lat_2:axis = "Y" ;
double time(time) ;
time:units = "hours since 2006-01-01 03:00:00" ;
time:calendar = "proleptic_gregorian" ;
float TISR ;
TISR:long_name = "TOA incident solar radiation" ;
TISR:units = "W m**2" ;
TISR:code = 212 ;
TISR:grid_type = "gaussian" ;
TISR:_FillValue = -999.f ;
float TSR ;
TSR:long_name = "Top solar radiation" ;
TSR:units = "W m**-2 s" ;
TSR:code = 178 ;
TSR:table = 128 ;
TSR:grid_type = "gaussian" ;
float TSRC ;
TSRC:long_name = "Top net solar radiation, clear sky" ;
TSRC:units = "W m**-2" ;
TSRC:code = 208 ;
TSRC:table = 128 ;
TSRC:grid_type = "gaussian" ;

// global attributes:
:CDI = "Climate Data Interface version 1.5.0 (http://code.zmaw.de/projects/cdi)" ;
:Conventions = "CF-1.0" ;
:history = "Sun Apr 08 10:01:16 2012: cdo merge /nobackup/rossby15/sm_marst/T159L62/TISR_ECE2_200601.nc Xfilter.nc merged.nc\n",
"Sun Apr 08 09:59:37 2012: cdo -t ecmwf mulc,0.0000925925925925925 filter.nc Xfilter.nc\n",
"Sun Apr 08 09:59:36 2012: cdo -f nc -R -t ecmwf copy filter.out filter.nc" ;
:CDO = "Climate Data Operators version 1.5.0 (http://code.zmaw.de/projects/cdo)" ;
:institution = "ECMWF" ;
data:

lat_2 = 89.1415194264611, 88.0294288679515, 86.910770814124, 
85.7906288836365, 84.6699240844465, 83.5489469125421, 82.4278175240078,
81.3065945226689, 80.1853098724772, 79.0639824814086, 77.9426242466729,
76.8212430271002, 75.6998442220113, 74.5784316632959, 73.4570081455833,
72.3355757549091, 71.214136079887, 70.0926903516245, 68.9712395389358,
67.8497844146698, 66.7283256028822, 65.6068636130102, 64.4853988650433,
63.3639317083405, 62.2424624358907, 61.1209912952521, 59.9995184970404,
58.8780442215827, 57.7565686241836, 56.6350918393302, 55.5136139840772,
54.3921351607921, 53.2706554593984, 52.1491749592204, 51.0276937305087,
49.906211835711, 48.784729330535, 47.6632462648426, 46.5417626834057,
45.4202786265483, 44.298794130694, 43.1773092288349, 42.0558239509352,
40.9343383242788, 39.8128523737712, 38.6913661222016, 37.5698795904715,
36.4483927977945, 35.3269057618723, 34.2054184990488, 33.0839310244466,
31.962443352088, 30.8409554950018, 29.7194674653187, 28.5979792743565,
27.4764909326964, 26.3550024502506, 25.2335138363243, 24.1120250996709,
22.9905362485413, 21.8690472907301, 20.747558233616, 19.6260690841993,
18.5045798491365, 17.3830905347709, 16.2616011471617, 15.1401116921107,
14.018622175186, 12.8971326017452, 11.7756429769564, 10.6541533058176,
9.53266359317569, 8.41117384374318, 7.28968406211511, 6.16819425278443,
5.04670442015713, 3.92521456856645, 2.80372470228675, 1.68223482554707,
0.560744942544222, -0.560744942544222, -1.68223482554707,
-2.80372470228675, -3.92521456856645, -5.04670442015713,
-6.16819425278443, -7.28968406211511, -8.41117384374318,
-9.53266359317569, -10.6541533058176, -11.7756429769564,
-12.8971326017452, -14.018622175186, -15.1401116921107,
-16.2616011471617, -17.3830905347709, -18.5045798491365,
-19.6260690841993, -20.747558233616, -21.8690472907301,
-22.9905362485413, -24.1120250996709, -25.2335138363243,
-26.3550024502506, -27.4764909326964, -28.5979792743565,
-29.7194674653187, -30.8409554950018, -31.962443352088,
-33.0839310244466, -34.2054184990488, -35.3269057618723,
-36.4483927977945, -37.5698795904715, -38.6913661222016,
-39.8128523737712, -40.9343383242788, -42.0558239509352,
-43.1773092288349, -44.298794130694, -45.4202786265483,
-46.5417626834057, -47.6632462648426, -48.784729330535, -49.906211835711,
-51.0276937305087, -52.1491749592204, -53.2706554593984,
-54.3921351607921, -55.5136139840772, -56.6350918393302,
-57.7565686241836, -58.8780442215827, -59.9995184970404,
-61.1209912952521, -62.2424624358907, -63.3639317083405,
-64.4853988650433, -65.6068636130102, -66.7283256028822,
-67.8497844146698, -68.9712395389358, -70.0926903516245,
-71.214136079887, -72.3355757549091, -73.4570081455833,
-74.5784316632959, -75.6998442220113, -76.8212430271002,
-77.9426242466729, -79.0639824814086, -80.1853098724772,
-81.3065945226689, -82.4278175240078, -83.5489469125421,
-84.6699240844465, -85.7906288836365, -86.910770814124,
-88.0294288679515, -89.1415194264611 ;
}

Replies (2)

RE: CDo merge nc files - Added by Uwe Schulzweida over 12 years ago

Could you please attach the inputfiles? That will help to optimize the grid compare function.

Cheers, Uwe

RE: CDo merge nc files - Added by Marston Ward over 12 years ago

Hi Uwe,

I avoided this problem by simply writing to file directly and using the intrinsic lat and lon data.
I'm working with large model data and there smallest files are too large to post here.

Thanks,
/M

    (1-2/2)