Project

General

Profile

multiple grids

Added by Gabe Bromley about 4 years ago

Hello,

I have a file with multiple grid descriptions. Its preventing me from completing some operations. How can I remove this generic grid? I would like to multiple two files together that use the same grid but i get:

cdo    mul (Abort): Grid size of the input parameters do not match!
And I think the generic grid is the problem. Below is the output from the sinfo command for the two files I would like to multiply together. I have additionally tried to use cdo setgrid to change the grid info to match the other file, but that didn't work either.

Thanks,
Gabe

   File format : NetCDF4 classic
    -1 : Institut Source   T Steptype Levels Num    Points Num Dtype : Parameter ID
     1 : unknown  Daymet   v instant       1   1         1   1  I16  : -1            
     2 : unknown  Daymet   v instant       1   1    259200   2  F32  : -2            
   Grid coordinates :
     1 : generic                  : points=1
     2 : 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 :  25 steps
     RefTime =  1980-01-01 00:00:00  Units = days  Calendar = standard  Bounds = true
  YYYY-MM-DD hh:mm:ss  YYYY-MM-DD hh:mm:ss  YYYY-MM-DD hh:mm:ss  YYYY-MM-DD hh:mm:ss
  2011-04-16 00:00:00  2011-05-16 12:00:00  2011-06-16 00:00:00  2011-07-16 12:00:00
  2011-08-16 12:00:00  2011-09-16 00:00:00  2011-10-16 12:00:00  2011-11-16 00:00:00
  2011-12-16 12:00:00  2012-01-16 12:00:00  2012-02-15 12:00:00  2012-03-16 12:00:00
  2012-04-16 00:00:00  2012-05-16 12:00:00  2012-06-16 00:00:00  2012-07-16 12:00:00
  2012-08-16 12:00:00  2012-09-16 00:00:00  2012-10-16 12:00:00  2012-11-16 00:00:00
  2012-12-16 00:00:00  2013-01-16 12:00:00  2013-02-15 00:00:00  2013-03-16 12:00:00
  2013-04-01 12:00:00
cdo    sinfo: Processed 2 variables over 25 timesteps [0.08s 35MB].
(base) gbromley@cheyenne4:/glade/work/gbromley/verification_data/daymet/precip> cdo sinfo study_area_crugrid.nc 
   File format : NetCDF
    -1 : Institut Source   T Steptype Levels Num    Points Num Dtype : Parameter ID
     1 : unknown  unknown  c instant       1   1    259200   1  F64  : -1            
   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
cdo    sinfo: Processed 1 variable [0.02s 16MB].

Replies (1)

RE: multiple grids - Added by Karin Meier-Fleischer about 4 years ago

Hi Gabe,

you can select the second grid with the selgrid operator. Suppose infile1 has grid B and infile2 has grids A and B then you have to tell CDO which grid to be used for infile2 (default is always the first grid).

cdo -mul infile1 -selgrid,2 infile2 outfile

-Karin

    (1-1/1)