Problems with forced precision information changes using CDO
Added by Changmook Lim about 4 years ago
Hi, I'm Changmook, a CDO user.
First, thank you for continuously providing convenient operators.
I'm having a problem that forced variable information to change when I use CDO for my data.
e.g.)
[my raw data's attribute]
$> ncdump -h test.nc
dimensions:
time = UNLIMITED ; // (5 currently)
level = 20 ;
lat = 73 ;
lon = 144 ;
variables:
double time(time) ;
time:_FillValue = 9.96920996838687e+36 ;
time:original_name = "Lead Time of Forecast in months" ;
time:units = "days since 1900-01-01" ;
time:calendar = "standard" ;
- int level(level) ;*
level:original_units = "Ensemble Member (no units)" ;
level:units = "m" ;
level:original_name = "Ensemble Members" ;
float lat(lat) ;
lat:nlat = 73 ;
lat:long_name = "latitude" ;
lat:units = "degrees_north" ;
float lon(lon) ;
lon:nlon = 144 ;
lon:long_name = "longitude" ;
lon:units = "degrees_east" ;
float t2m(time, level, lat, lon) ;
t2m:long_name = "Temperature at 2m" ;
t2m:units = "deg K" ;
t2m:missing_value = 1.e+20f ;
t2m:_FillValue = 1.e+20f ;
// global attributes:
:creation_date = "Fri Mar 20 17:29:27 KST 2020" ;
:Conventions = "None" ;
:title = "Written using AFS function write_TLLL" ;
:institute = "CMCC" ;
:model = "SPS3" ;
}
When using CDO !! (CDO version 1.9.8)
$> cdo copy test.nc test2.nc
$> ncdump -h test2.nc
dimensions:
time = UNLIMITED ; // (5 currently)
lon = 144 ;
lat = 73 ;
level = 20 ;
variables:
double time(time) ;
time:standard_name = "time" ;
time:units = "days since 1900-01-01" ;
time:calendar = "standard" ;
time:axis = "T" ;
float lon(lon) ;
lon:standard_name = "longitude" ;
lon:long_name = "longitude" ;
lon:units = "degrees_east" ;
lon:axis = "X" ;
float lat(lat) ;
lat:standard_name = "latitude" ;
lat:long_name = "latitude" ;
lat:units = "degrees_north" ;
lat:axis = "Y" ;
- double level(level) ;*
level:units = "m" ;
level:axis = "Z" ;
level:original_units = "Ensemble Member (no units)" ;
level:original_name = "Ensemble Members" ;
float t2m(time, level, lat, lon) ;
t2m:long_name = "Temperature at 2m" ;
t2m:units = "deg K" ;
t2m:_FillValue = 1.e+20f ;
t2m:missing_value = 1.e+20f ;
// global attributes:
:CDI = "Climate Data Interface version 1.9.8 (https://mpimet.mpg.de/cdi)" ;
:Conventions = "None" ;
:history = "Thu Feb 04 20:10:07 2021: cdo copy test.nc test2.nc" ;
:creation_date = "Fri Mar 20 17:29:27 KST 2020" ;
:title = "Written using AFS function write_TLLL" ;
:institute = "CMCC" ;
:model = "SPS3" ;
:CDO = "Climate Data Operators version 1.9.8 (https://mpimet.mpg.de/cdo)" ;
}
The variable information is changed (integer to double) as above.
Is there any way to use CDO operator without changing the variable information?
Or.. is there a operator (using CDO) that can change the level information back to integer?
help me plz...
Replies (2)
RE: Problems with forced precision information changes using CDO - Added by Brendan DeTracey about 4 years ago
I don't think so. There are the precision options (https://code.mpimet.mpg.de/projects/cdo/embedded/index.html#x1-70001.2.1) but they will not give you the result you want.
RE: Problems with forced precision information changes using CDO - Added by Uwe Schulzweida over 3 years ago
This problem will be fixed in the next CDO release 2.0.0. The datatype of the level coordinate will then remain as it was read in.