Project

General

Profile

data values are outside the valid range of the used output precision!

Added by Yan Zhao over 4 years ago

Hello,
When I typed the simple cdo command as "cdo mulc,0.6 input.nc output.nc", the following informations appeared:

Warning: Some data values (min=-53222 max=-16750) are outside the

valid range (-32768 - 32767) of the used output precision!
Use the CDO option -b F32 or -b F64 to increase the output precision.

cdf_put_vara_double: name=sp type=NC_SHORT minval=-53222.000000 maxval=-16750.000000

Error (cdf_put_vara_double): NetCDF: Numeric conversion not representable

The information of the input data (attached) is as such:
.........
short sp(time, lat, lon) ;
sp:standard_name = "surface_air_pressure" ;
sp:long_name = "Surface pressure" ;
sp:units = "Pa" ;
sp:add_offset = 76390.8482127444 ;
sp:scale_factor = 0.862168261124166 ;
sp:_FillValue = -32767s ;
sp:missing_value = -32767s ;

I attempted to use ncatted to change the _FillValue from 32767 to others values as 999999 or 1.0e36. With the command of "cdo mule,0.6 ....", the similar error information " outside the valid range" still existed.
What's the problem of valid range? How to use cdo -b F32 or F64 if it works?

Any help is appreciated!
Yana


Replies (2)

RE: data values are outside the valid range of the used output precision! - Added by Karin Meier-Fleischer over 4 years ago

Hi Yan,

the variable sp is of type short which causes the error when you try to multiplicate it with a float.
CDO tells you what is going on and how to fix it:

cdo mulc (Warning): Some data values (min=-53222 max=-16750) are outside the
valid range (-32768 - 32767) of the used output precision!
Use the CDO option -b F32 or -b F64 to increase the output precision.
cdf_put_vara_double: name=sp type=NC_SHORT minval=-53222.000000 maxval=-16750.000000

cdo -b F32 -mulc,0.6 ERA5_Psurf_1980Jan.nc outfile.nc

Read the warnings and error messages carefully aswell as the options part of the CDO documentation for the meaning of -b F32.

-Karin

RE: data values are outside the valid range of the used output precision! - Added by Yan Zhao over 4 years ago

Thanks Karin for your reply. I got it. It seems so simple but works well.

    (1-2/2)