convert the double _FillValue to float one
Added by Beata Szabo-Takacs over 7 years ago
I would like to calculate multi year seasonal mean by:
cdo yseasmean MPI-ESM-LR-CLM4.8.17_wet_power.nc MPI-ESM-LR-CLM4.8.17_wet_power_sm.nc
but I got the following error messages:
cdf_put_vara_double : ncid = 131072 varid = 3 val0 = -999.000000
cdf_put_vara_double : varname = pr
Error (cdf_put_vara_double) : NetCDF: Numeric conversion not representable
I do not understand why I got this error because _FillValue is float:
netcdf MPI-ESM-LR-CLM4.8.17_wet_power {
dimensions:
longitude = 464 ;
latitude = 201 ;
time = 5479 ;
variables:
float longitude(longitude) ;
longitude:long_name = "longitude" ;
longitude:standard_name = "lon" ;
longitude:units = "degrees_east" ;
float latitude(latitude) ;
latitude:long_name = "latitude" ;
latitude:standard_name = "lat" ;
latitude:units = "degrees_north" ;
double time(time) ;
time:long_name = "time" ;
time:standard_name = "time" ;
time:units = "days since 1949-12-1 00:00:00" ;
float pr(time, latitude, longitude) ;
pr:_FillValue = -999.f ;
pr:long_name = "precipitation" ;
pr:standard_name = "precipitation_flux" ;
pr:units = "mm" ;
pr:cell_methods = "time: mean" ;
// global attributes:
:history = "Mon Jun 19 09:52:46 2017: ncatted -O -a _FillValue,pr,m,f,-999 MPI-ESM-LR-CLM4.8.17_wet_power.nc\n",
"Mon Jun 19 09:22:52 2017: ncatted -O -a missing_value,,d,, MPI-ESM-LR-CLM4.8.17_wet_power.nc" ;
}
I tried to modify the _FillValue from -999.000000 to -999 by
cdo setmissval,-999 MPI-ESM-LR-CLM4.8.17_wet_power.nc MPI-ESM-LR-CLM4.8.17_wet_power2.nc
but I got the same error message.
Could someone write me how I should convert the _FillValue to -999?
Thank you for your response in advance!
Kind regards,
Beata
Replies (6)
RE: convert the double _FillValue to float one - Added by Ralf Mueller over 7 years ago
Hi Beata!
please upload some sample data
cheers
ralf
RE: convert the double _FillValue to float one - Added by Beata Szabo-Takacs over 7 years ago
Hi Ralf,
I attached a sample.nc which contains the first 5 days.
Cheers,
Beata
RE: convert the double _FillValue to float one - Added by Ralf Mueller over 7 years ago
but this file already has a fillValue of -999.0.
I use cdo-1.8.2 and cannot reproduce your errors. Which version do you use?
cheers
ralf
RE: convert the double _FillValue to float one - Added by Beata Szabo-Takacs over 7 years ago
Hello Ralf,
I use cdo-1.7.2
Cheers,
Beata
RE: convert the double _FillValue to float one - Added by Ralf Mueller over 7 years ago
can you update?
RE: convert the double _FillValue to float one - Added by Beata Szabo-Takacs over 7 years ago
Yes, I will update. Thank you for your help!
Have a nice day,
Beata