Project

General

Profile

remapbil: Unsupported grid type: generic, ncatted

Added by Iris Hinrichs almost 13 years ago

Hi,

I am trying to remap pco2_ant.nc from a orthogonal curvilinear grid to a regular lat-lon-grid. As some users before, I encounter the problem of the unsupported generic grid.
Information about pco2_ant.nc:

cdo sinfov pco2_ant.nc
File format: netCDF
-1 : Institut Source Varname Time Typ Grid Size Num Levels Num
1 : unknown unknown scal_lon con F32 12322 1 1 1
2 : unknown unknown scal_lat con F32 12322 1 1 1
3 : unknown unknown pco2_ant var F32 12322 1 1 1
Horizontal grids :
1 : generic > size : dim = 12322 nx = 122 ny = 101
Vertical grids :
1 : surface : 0
Time axis : 12 steps
YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss
0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00
0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00
0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00
cdo sinfov: Processed 3 variables over 12 timesteps. ( 0.00s )

scal_lon and scal_lat contain the information about the grid.
To make this information an attribute of pco2_ant, I tried the following which I found in this forum:

ncatted -a coordinates,pco2_ant,c,c,"scal_lon scal_lat" pco2_ant.nc

but still, remapbil does not work and I get

cdo remapbil (Abort): Unsupported grid type: generic

I somehow have the impression that this is rather an NCO-command problem...
I'd be very grateful for any helpful hint!
Thanks and with best regards,
Iris


Replies (5)

RE: remapbil: Unsupported grid type: generic, ncatted - Added by Uwe Schulzweida almost 13 years ago

Could you please attach the netCDF file or at least the netCDF header (ncdump -h)?

RE: remapbil: Unsupported grid type: generic, ncatted - Added by Iris Hinrichs almost 13 years ago

Here comes the header:

netcdf pco2_ant {
dimensions:
x = 122 ;
y = 101 ;
time = UNLIMITED ; // (12 currently)
variables:
double time(time) ;
time:units = "day as %Y%m%d.%f" ;
time:calendar = "proleptic_gregorian" ;
float scal_lon(y, x) ;
scal_lon:long_name = "2-d longitude of scalar grid cells" ;
scal_lon:units = "degree E" ;
scal_lon:_FillValue = 99999.f ;
float scal_lat(y, x) ;
scal_lat:long_name = "2-d longitude of scalar grid cells" ;
scal_lat:units = "degree N" ;
scal_lat:_FillValue = 99999.f ;
float pco2_ant(time, y, x) ;
pco2_ant:long_name = "ant. CO2 partial-pressure" ;
pco2_ant:units = "ppm" ;
pco2_ant:_FillValue = 99999.f ;

// global attributes:
:CDI = "Climate Data Interface version 1.4.5.1 (http://code.zmaw.de/projects/cdi)" ;
:Conventions = "CF-1.0" ;
:history = "Tue May 24 11:13:23 2011: cdo selname,pco2_ant,scal_lat,scal_lon bgcmean_2d.nc pco2_ant.nc\n",
"Mean monthly output for marine bgc modules" ;
:title = "Mean monthly output for marine bgc modules" ;
:conventions = "COARDS" ;
:date = 1991, 1, 31, 13035450, 11567770 ;
:CDO = "Climate Data Operators version 1.4.5.1 (http://code.zmaw.de/projects/cdo)" ;
}

RE: remapbil: Unsupported grid type: generic, ncatted - Added by Uwe Schulzweida almost 13 years ago

Hi Iris,

The units of the coordinates have to follow exactly the CF convention. Otherwise it is not possible to detect the right coordinates. Here is a list of all acceptable units for longitude coordinates:

degrees_east, degree_east, degree_E, degrees_E, degreeE, and degreesE
Use ncatted to rename the attributes. Here is an example:
ncatted -a units,scal_lon,m,c,"degreeE" -a units,scal_lat,m,c,"degreeN"  file.nc

Best regards,
Uwe

RE: remapbil: Unsupported grid type: generic, ncatted - Added by Iris Hinrichs almost 13 years ago

Hi Uwe,

thanks for your advice.
But unfortunately, it does not work.
I changed the attribute "units" of scal_lon and scal_lat as you suggested. When I did ncdump -h, the attributes appeared to be "degreeE" and "degreeN". Fine.
Then I tried again to create the attribute "coordinates" for pco2_ant using scal_lat and scal_lon. The value of the attribute then appears to be 0, which is weird.
And still, remapbil reports a generic grid which it does not support.
Right now, I am thinking about, if there is another way to provide remapbil with information about the grid. All I know about the grid is, that it is a orthogonal-curvilinear Cgrid as used in the MPI-OM.
I attach the file NeCDF-file, with which I have the remapping problem.

With many thanks for further help in advance,
Iris

RE: remapbil: Unsupported grid type: generic, ncatted - Added by Uwe Schulzweida almost 13 years ago

Hi Iris,

You have to change the third parameter of the option -a in the call to ncatted. 'c' means create an attribute. You have to use 'm' to modify an existing attribute:

ncatted -a coordinates,pco2_ant,m,c,"scal_lon scal_lat" pco2_ant.nc

An other way to provide the required grid information is the CDO operator setgrid:
cdo remapbil,targetgrid  -setgrid,sourcegrid  ifile  ofile
'sourcegrid' is a file with the description of the grid.

Best regards,
Uwe

    (1-5/5)