Project

General

Profile

-sellonlatbox function doesn't works properly

Added by Sonny L about 4 years ago

Hi all,

I need to extract data from global domain to subdomain, unfortunalty once I extract the data using -sellonlatbox function the values on cells are unrealistic.
the function used is cdo -sellonlatbox,-120,70,20,80 globaldomain.nc subdomain.nc.

to note, the netcdf inputfile is generated from ascii file, using the following command
cdo -f nc -settaxis,2000-01-01,00:00:00,1day -setname,sens -input,gridfile.txt globaldomain.nc < globaldomain.dat

all the files used are attached

many thanks,
S.


Replies (2)

RE: -sellonlatbox function doesn't works properly - Added by Karin Meier-Fleischer about 4 years ago

Hi Sonny,

your gridfile.txt is wrong and the sellonlatbox parameter are not the same as the one you use for subdomain.nc.

cdo sinfon globaldomain.nc

   File format : NetCDF
    -1 : Institut Source   T Steptype Levels Num    Points Num Dtype : Parameter name
     1 : unknown  unknown  v instant       1   1    259200   1  F32  : sens          
   Grid coordinates :
     1 : lonlat                   : points=259200 (720x360)
                              lon : 0 to 359.5 by 0.5 degrees_east  circular
                              lat : 0 to 179.5 by 0.5 degrees_north
   Vertical coordinates :
     1 : surface                  : levels=1
   Time coordinate :  1 step
     RefTime =  2000-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
  2000-01-01 00:00:00

Correct gridfile.txt:

 gridtype  = lonlat
 xsize     = 720
 ysize     = 360
 xfirst    = 0.0
 xinc   = 0.5
 yfirst = -89.5
 yinc   = 0.5

cdo -f nc input,my_gridfile.txt globaldomain.nc < globaldomain.dat

cdo sinfon globaldomain.nc

   File format : NetCDF2
    -1 : Institut Source   T Steptype Levels Num    Points Num Dtype : Parameter name
     1 : unknown  unknown  v instant       1   1    259200   1  F32  : var1          
   Grid coordinates :
     1 : lonlat                   : points=259200 (720x360)
                              lon : 0 to 359.5 by 0.5 degrees_east  circular
                              lat : -89.5 to 90 by 0.5 degrees_north
   Vertical coordinates :
     1 : surface                  : levels=1
   Time coordinate :  1 step
     RefTime =  0001-01-01 00:00:00  Units = hours  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
 -0001-11-30 00:00:00

cdo -sellonlatbox,-120,70,20,60 globaldomain.nc subdomain.nc

cdo sinfon subdomain.nc

   File format : NetCDF2
    -1 : Institut Source   T Steptype Levels Num    Points Num Dtype : Parameter name
     1 : unknown  unknown  v instant       1   1     30861   1  F32  : var1          
   Grid coordinates :
     1 : lonlat                   : points=30861 (381x81)
                              lon : -120 to 70 by 0.5 degrees_east
                              lat : 20 to 60 by 0.5 degrees_north
   Vertical coordinates :
     1 : surface                  : levels=1
   Time coordinate :  1 step
     RefTime =  0001-01-01 00:00:00  Units = hours  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
 -0001-11-30 00:00:00

-Karin

RE: -sellonlatbox function doesn't works properly - Added by Sonny L about 4 years ago

Hi Karin,

thank you so much !

-S

    (1-2/2)