Project

General

Profile

Grid description file contains illegal characters

Added by Chris Fletcher over 10 years ago

I am trying to regrid a reanalysis product to a model grid using this command:
cdo remapbil,target_grid.nc indata.nc out.nc

but I receive the following error message that I cannot decipher:

cdo remapbil (Warning): Unexpected rank = 1!
cdo remapbil (Abort): Grid description file >target_grid.nc.nc< contains illegal characters (line: #HDF)!

I am attaching the two files, and here is the output of my cdo -V:

Climate Data Operators version 1.6.2 (http://code.zmaw.de/projects/cdo)
Compiler: gcc -std=gnu99 -g -O2 -pthread
 version: gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
Compiled: by cgf on strauss (x86_64-unknown-linux-gnu) Nov 13 2013 22:17:24
Features: PTHREADS NC4 OPeNDAP SZ Z PROJ.4
Libraries: proj/4.8
Filetypes: srv ext ieg grb nc nc2 nc4 nc4c 
     CDI library version : 1.6.2 of Nov 13 2013 22:17:16
 CGRIBEX library version : 1.6.2 of Oct  9 2013 11:03:55
  netCDF library version : 4.2 of Nov 10 2012 10:39:18 $
    HDF5 library version : 1.8.8
 SERVICE library version : 1.3.1 of Nov 13 2013 22:17:02
   EXTRA library version : 1.3.1 of Nov 13 2013 22:16:55
     IEG library version : 1.3.1 of Nov 13 2013 22:16:59
    FILE library version : 1.8.2 of Nov 13 2013 22:16:55

Any help would be appreciated. Thanks.


Replies (3)

RE: Grid description file contains illegal characters - Added by Jaison-Thomas Ambadan over 10 years ago

the problem is that CDO cannot read your target_grid.nc; something incompatible in the NetCDF meta-data. Anyway if you simply:

1. ncdump target_grid.nc > mydat.dat
2. ncgen -o new_target.nc mydat.dat

now CDO can read your taget grid properly, and the remap works!

cdo remapbil,new_target.nc indata.nc out.nc

Cheers,
J

RE: Grid description file contains illegal characters - Added by Chris Fletcher over 10 years ago

Thanks for your response, the solution certainly works. Although I cannot immediately see why this works, since the output from these two commands on my system is identical:

cdo griddes new_target.nc
cdo griddes target_grid.nc

RE: Grid description file contains illegal characters - Added by Uwe Schulzweida over 10 years ago

Thanks for this report! This problem will be fixed in the next CDO release.

    (1-3/3)