Project

General

Profile

SCRIP grid example in documentation correct?

Added by Brendan DeTracey almost 5 years ago

Hi,
I am a little confused by the SCRIP grid example in the CDO documentation when I compare it to the SCRIP documentation.
  1. The CDO example is dimensioned by grid_ysize & grid_xsize, the SCRIP example by grid_size
  2. The CDO example uses datatypes int & float, whereas the CDO example uses long & double
    Do these differences matter to CDO? I am guessing that the datatypes matter, but the dimensions do not...

CDO documentation:

netcdf grob3s {
dimensions :
    grid_size = 12120 ;
    grid_xsize = 120 ;
    grid_ysize = 101 ;
    grid_corners = 4 ;
    grid_rank = 2 ;
variables :
    int grid_dims(grid_rank) ;
    float grid_center_lat(grid_ysize, grid_xsize) ;
         grid_center_lat : units = "degrees" ;
         grid_center_lat : bounds = "grid_corner_lat" ;
    float grid_center_lon(grid_ysize, grid_xsize) ;
         grid_center_lon : units = " degrees" ;
         grid_center_lon : bounds = " grid_corner_lon" ;
    int grid_imask(grid_ysize, grid_xsize) ;
         grid_imask : units = "unitless" ;
         grid_imask : coordinates = "grid_center_lon grid_center_lat" ;
    float grid_corner_lat(grid_ysize, grid_xsize, grid_corners) ;
         grid_corner_lat : units = "degrees" ;
    float grid_corner_lon(grid_ysize, grid_xsize, grid_corners) ;
        grid_corner_lon : units = "degrees" ;
// global attributes :
        : title = "grob3s" ;
}

SCRIP documentation:
netcdf remap_grid_T42 {
dimensions:
    grid_size = 8192 ;
    grid_corners = 4 ;
    grid_rank = 2 ;
variables:
    long grid_dims(grid_rank) ;
    double grid_center_lat(grid_size) ;
        grid_center_lat:units = "radians" ;
    double grid_center_lon(grid_size) ;
        grid_center_lon:units = "radians" ;
    long grid_imask(grid_size) ;
        grid_imask:units = "unitless" ;
    double grid_corner_lat(grid_size, grid_corners) ;
        grid_corner_lat:units = "radians" ;
    double grid_corner_lon(grid_size, grid_corners) ;
        grid_corner_lon:units = "radians" ;
// global attributes:
        :title = "T42 Gaussian Grid" ;
}

Can CDO read both?


Replies (3)

RE: SCRIP grid example in documentation correct? - Added by Brendan DeTracey almost 5 years ago

Dug into the source. I think the example in the CDO docs is incorrect. CDO requires the same NetCDF structure as SCRIP, but uses long and double datatypes. In CDO example replace grid_ysize, grid_xsize with grid_size and delete dimensions grid_ysize & grid_xsize

RE: SCRIP grid example in documentation correct? - Added by Uwe Schulzweida almost 5 years ago

Hi Brendan,

This is actually a bit inconsistent, thanks for the hint!
grid_xsize and grid_ysize was introduced in CDO, therefor this example grid can only be used for CDO.
I will correct the documention in the next CDO release.

In principle, the data type can be chosen at will. But the datatype long is not part of the netCDF standard.
So I will change the example to int & double.

Cheers,
Uwe

RE: SCRIP grid example in documentation correct? - Added by Brendan DeTracey almost 5 years ago

It is good to know that my misunderstanding can be of service.

    (1-3/3)