Project

General

Profile

unable to display a variable : CDO operator gradsdes

Added by Syed Ali over 6 years ago

I have a netcdf file which has a variable Band1 (see attached). I have thousands of such files which cannot be merged using CDO due to memory issue. Therefore, I made a grads control file using CDO operator gradsdes, as shown below. But when I open this control file in grads I get an error: Data Request Error: Error for variable 'band1' DISPLAY error: Invalid expression

  • Generated by CDO operator gradsdes *
    DSET ^Indus_maxt_19600102.flt.nc
    DTYPE netCDF
    XDEF 878 LINEAR 60.712500 0.025000
    YDEF 557 LINEAR 23.362500 0.025000
    ZDEF 1 LEVELS 0
    TDEF 1 LINEAR 00:00Z00jan0000 1mn
    TITLE Indus_maxt_19600102.flt.nc 878x557 grid
    UNDEF -999
    VARS 1
    Band1 0 y,x GDAL Band Number 1
    ENDVARS

Replies (1)

RE: unable to display a variable : CDO operator gradsdes - Added by Karin Meier-Fleischer about 6 years ago

Hi Syed,

this is more a question of how to open a netCDF file in GrADS. If you would have taken a look into your netCDF file you would have seen

ncdump -h Indus_maxt_19620316.flt.nc

netcdf Indus_maxt_19620316.flt {
dimensions:
    lon = 878 ;
    lat = 557 ;
variables:
    char crs ;
        crs:grid_mapping_name = "latitude_longitude" ;
        crs:long_name = "CRS definition" ;
        crs:longitude_of_prime_meridian = 0. ;
        crs:semi_major_axis = 6378137. ;
        crs:inverse_flattening = 298.257223563 ;
        crs:spatial_ref = "GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]]" ;
        crs:GeoTransform = "60.7 0.025 0 37.27500000000001 0 -0.025 " ;
    double lat(lat) ;
        lat:standard_name = "latitude" ;
        lat:long_name = "latitude" ;
        lat:units = "degrees_north" ;
    double lon(lon) ;
        lon:standard_name = "longitude" ;
        lon:long_name = "longitude" ;
        lon:units = "degrees_east" ;
    float Band1(lat, lon) ;
        Band1:long_name = "GDAL Band Number 1" ;
        Band1:_FillValue = -999.f ;
        Band1:grid_mapping = "crs" ;

// global attributes:
        :Conventions = "CF-1.5" ;
        :GDAL = "GDAL 2.2.2, released 2017/09/15" ;
        :history = "Thu Nov 09 10:11:18 2017: GDAL CreateCopy( Indus_maxt_19620316.flt.nc, ... )" ;
}

This tells you that you can directly load the file within grads:

grads -lc "sdfopen  Indus_maxt_19620316.flt.nc" 

You don't need a descriptor file because it is netcdf with dimension names lat and lon.

-Karin

    (1-1/1)