Project

General

Profile

convert rotated curvilinear grid to geographic

Added by Abdoulaye SARR over 9 years ago

I have cclm model output in curvilinear grid (netcdf) and want to convert to geographic coordinate using cdo for my postproceesing.
A sample file is attached.

eus


Replies (4)

RE: convert rotated curvilinear grid to geographic - Added by Abdoulaye SARR over 9 years ago

Hi Uwe, do you know how to handle this kind of output from cclm model? The postprocessing software I am use can't handle this grid.

RE: convert rotated curvilinear grid to geographic - Added by Uwe Schulzweida over 9 years ago

The coordinates of this curvilinear grid are the same for each row and column. That means you can convert these coordinates simple to a regular lonlat grid:

cdo setgridtype,lonlat lffd1999010100tmax.nc  result.nc

RE: convert rotated curvilinear grid to geographic - Added by Abdoulaye SARR over 9 years ago

I am back on the same topic to see if the attached file can also be converted to lonlat? When I do it as on Uwe previous suggestion I am getting an error message:
cdo setgridtype (Abort): Unsupported grid name: lonlat
HDF5-DIAG: Error detected in HDF5 (1.8.13) thread 0:
#000: H5T.c line 1766 in H5Tclose(): not a datatype
major: Invalid arguments to routine
minor: Inappropriate type

Error (cdf_close) : NetCDF: HDF error

I attach the file expecting support.

Thanks

RE: convert rotated curvilinear grid to geographic - Added by Uwe Schulzweida over 9 years ago

Here is the output of 'cdo sinfon lffd1998010100.nc':

   File format : netCDF4 classic ZIP
    -1 : Institut Source   Ttype    Levels Num    Points Num Dtype : Parameter name
     1 : unknown  cclm.exe constant      1   1     12500   1  F32z : slonu         
     2 : unknown  cclm.exe constant      1   1     12500   1  F32z : slatu         
     3 : unknown  cclm.exe constant      1   1     12500   2  F32z : slonv         
     4 : unknown  cclm.exe constant      1   1     12500   2  F32z : slatv         
     5 : unknown  cclm.exe constant      1   1        41   3  F32z : vcoord        
     6 : unknown  cclm.exe instant      41   2     12500   4  F32z : W             
   Grid coordinates :
     1 : lonlat                   : points=12500 (125x100)
                            srlon : -29.78 to 24.78 by 0.44 degrees
                             rlat : -10 to 33.56 by 0.44 degrees
     2 : lonlat                   : points=12500 (125x100)
                             rlon : -30 to 24.56 by 0.44 degrees
                            srlat : -9.78 to 33.78 by 0.44 degrees
     3 : generic                  : points=41
     4 : curvilinear              : points=12500 (125x100)
                              lon : -30 to 24.56 degrees_east
                              lat : -10 to 33.56 degrees_north
   Vertical coordinates :
     1 : surface                  : levels=1
     2 : generic                  : levels=41
                              lev : 1 to 41 by 1 level
   Time coordinate :  1 step
     RefTime =  1998-01-01 00:00:00  Units = seconds  Calendar = proleptic_gregorian  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
  1998-01-01 00:00:00
CDO found 6 data variables, some of them are already on a regular lon/lat. Only the variable W is on a curvilinear grid. You can apply the operator setgridtype only to this variable. Here is an example:
cdo setgridtype,lonlat -select,name=W lffd1998010100.nc result.nc

    (1-4/4)