Project

General

Profile

Set missing values to 1.e+20f

Added by Luke Johnson over 1 year ago

Hi, I have an input file with _FillValue and missing_value equal to NaN. I would like the output file to have both equal 1.e+20f instead. I've tried a variety of combinations (setmissval,setmisstoc,-m option) but can't figure out a solution. For example, if I run...
cdo -setmissval,1.e+20f -div ifile1 ifile2 ofile
...then I'm met with the following error:
cdo(2) setmissval (Abort): Float parameter >1.e+20f< contains invalid character at position 7!

I'm new to CDO so maybe this is something simple that I'm overlooking/misunderstanding, but I would appreciate any advice/help. Thanks!


Replies (3)

RE: Set missing values to 1.e+20f - Added by Luke Johnson over 1 year ago

I just saw the recommendation to post the output of CDO -V – here it is:

Climate Data Operators version 2.0.5 (https://mpimet.mpg.de/cdo)
System: x86_64-pc-linux-gnu
CXX Compiler: g++ -std=gnu++14 -g -O2 -fopenmp -pthread
CXX version : g++ (GCC) 10.2.0
C Compiler: gcc -g -O2 -fopenmp -pthread -pthread
C version : gcc (GCC) 10.2.0
F77 Compiler: gfortran -g -O2
F77 version : GNU Fortran (GCC) 10.2.0
Features: 249GB 48threads C++14 OpenMP45 Fortran PTHREADS HDF5 NC4/HDF5 OPeNDAP SZ UDUNITS2 PROJ CURL SSE2
Libraries: HDF5/1.12.2 proj/5.2.0 curl/7.37.0(h7.84.0)
CDI data types: SizeType=size_t  DateType=int64_t
CDI file types: srv ext ieg grb1 grb2 nc1 nc2 nc4 nc4c nc5 
     CDI library version : 2.0.5
 cgribex library version : 2.0.1
 ecCodes library version : 2.1.0
  NetCDF library version : 4.9.0 of Jul 26 2022 11:54:33 $
    hdf5 library version : 1.12.2
    exse library version : 1.4.2
    FILE library version : 1.9.1

Also, here is the output from sinfon:

   File format : NetCDF4 classic zip
    -1 : Institut Source   T Steptype Levels Num    Points Num Dtype : Parameter name
     1 : unknown  EC-Earth3-AerChem v instant       1   1    259200   1  F64z : sfo3          
   Grid coordinates :
     1 : lonlat                   : points=259200 (720x360)
                              lon : -179.75 to 179.75 by 0.5 degrees_east  circular
                              lat : 89.75 to -89.75 by -0.5 degrees_north
   Vertical coordinates :
     1 : surface                  : levels=1
   Time coordinate :
                             time : 8760 steps
     RefTime =  1860-01-01 00:00:00  Units = days  Calendar = proleptic_gregorian
  YYYY-MM-DD hh:mm:ss  YYYY-MM-DD hh:mm:ss  YYYY-MM-DD hh:mm:ss  YYYY-MM-DD hh:mm:ss
  1985-01-01 00:30:00  1985-01-01 01:30:00  1985-01-01 02:30:00  1985-01-01 03:30:00
  1985-01-01 04:30:00  1985-01-01 05:30:00  1985-01-01 06:30:00  1985-01-01 07:30:00
  1985-01-01 08:30:00  1985-01-01 09:30:00  1985-01-01 10:30:00  1985-01-01 11:30:00
  1985-01-01 12:30:00  1985-01-01 13:30:00  1985-01-01 14:30:00  1985-01-01 15:30:00
  1985-01-01 16:30:00  1985-01-01 17:30:00  1985-01-01 18:30:00  1985-01-01 19:30:00
  1985-01-01 20:30:00  1985-01-01 21:30:00  1985-01-01 22:30:00  1985-01-01 23:30:00
  1985-01-02 00:30:00  1985-01-02 01:30:00  1985-01-02 02:30:00  1985-01-02 03:30:00
  1985-01-02 04:30:00  1985-01-02 05:30:00  1985-01-02 06:30:00  1985-01-02 07:30:00
  1985-01-02 08:30:00  1985-01-02 09:30:00  1985-01-02 10:30:00  1985-01-02 11:30:00
  1985-01-02 12:30:00  1985-01-02 13:30:00  1985-01-02 14:30:00  1985-01-02 15:30:00
  1985-01-02 16:30:00  1985-01-02 17:30:00  1985-01-02 18:30:00  1985-01-02 19:30:00
  1985-01-02 20:30:00  1985-01-02 21:30:00  1985-01-02 22:30:00  1985-01-02 23:30:00
  1985-01-03 00:30:00  1985-01-03 01:30:00  1985-01-03 02:30:00  1985-01-03 03:30:00
  1985-01-03 04:30:00  1985-01-03 05:30:00  1985-01-03 06:30:00  1985-01-03 07:30:00
  1985-01-03 08:30:00  1985-01-03 09:30:00  1985-01-03 10:30:00  1985-01-03 11:30:00
   ................................................................................
   ................................................................................
   ..............................................................................
  1985-12-29 12:30:00  1985-12-29 13:30:00  1985-12-29 14:30:00  1985-12-29 15:30:00
  1985-12-29 16:30:00  1985-12-29 17:30:00  1985-12-29 18:30:00  1985-12-29 19:30:00
  1985-12-29 20:30:00  1985-12-29 21:30:00  1985-12-29 22:30:00  1985-12-29 23:30:00
  1985-12-30 00:30:00  1985-12-30 01:30:00  1985-12-30 02:30:00  1985-12-30 03:30:00
  1985-12-30 04:30:00  1985-12-30 05:30:00  1985-12-30 06:30:00  1985-12-30 07:30:00
  1985-12-30 08:30:00  1985-12-30 09:30:00  1985-12-30 10:30:00  1985-12-30 11:30:00
  1985-12-30 12:30:00  1985-12-30 13:30:00  1985-12-30 14:30:00  1985-12-30 15:30:00
  1985-12-30 16:30:00  1985-12-30 17:30:00  1985-12-30 18:30:00  1985-12-30 19:30:00
  1985-12-30 20:30:00  1985-12-30 21:30:00  1985-12-30 22:30:00  1985-12-30 23:30:00
  1985-12-31 00:30:00  1985-12-31 01:30:00  1985-12-31 02:30:00  1985-12-31 03:30:00
  1985-12-31 04:30:00  1985-12-31 05:30:00  1985-12-31 06:30:00  1985-12-31 07:30:00
  1985-12-31 08:30:00  1985-12-31 09:30:00  1985-12-31 10:30:00  1985-12-31 11:30:00
  1985-12-31 12:30:00  1985-12-31 13:30:00  1985-12-31 14:30:00  1985-12-31 15:30:00
  1985-12-31 16:30:00  1985-12-31 17:30:00  1985-12-31 18:30:00  1985-12-31 19:30:00
  1985-12-31 20:30:00  1985-12-31 21:30:00  1985-12-31 22:30:00  1985-12-31 23:30:00
cdo    sinfon: Processed 1 variable over 8760 timesteps [0.29s 18MB].

RE: Set missing values to 1.e+20f - Added by Uwe Schulzweida over 1 year ago

Remove the f at the end of the missing value, then it will work:

cdo -setmissval,1.e+20 -div ifile1 ifile2 ofile

RE: Set missing values to 1.e+20f - Added by Luke Johnson over 1 year ago

Hi Uwe, thanks for the quick reply and solution, which works as you said. I added in the -b <nbyte> option to specify -b f32, which gave my output file's variable the desired 1.0E20f for _FillValue and missing_value.

    (1-3/3)