Project

General

Profile

another "remapbil (Abort): Unsupported generic coordinates" question

Added by Noam Chomsky about 4 years ago

I am sorry about asking this again, I have gone through all the threads in the forum but for some reason the solutions are not working for my case. I have two files that have generic grid types:

@netcdf frac {
dimensions:
patch = 12 ;
lon = 7200 ;
lat = 3600 ;
variables:
float patch(patch) ;
float lon(lon) ;
float lat(lat) ;
float fractile(patch, lat, lon) ;
fractile:_FillValue = 999.f ;
fractile:coordinates = "lon lat" ;

and

netcdf mygrid {
dimensions:
lon = 180 ;
lat = 90 ;
patch = 12 ;
variables:
float lon(lon) ;
float lat(lat) ;
float LAI ;
LAI:coordinates = "lon lat" ;
@
I would like to remap using mygrid as the template so I have tried

cdo remapbil,mygrid.nc frac.nc fracout.nc

And I tried

ncatted -a coordinates,LAI,c,c,"lon lat" mygrid.nc
ncatted -a coordinates,fractile,c,c,"lon lat" frac.nc

but I get remapbil (Abort): Unsupported generic coordinates (Variable: fractile)!

What I am missing?

Many thanks


Replies (4)

RE: another "remapbil (Abort): Unsupported generic coordinates" question - Added by Noam Chomsky about 4 years ago

I forgot the information regarding the grids of the 'mygrid.nc' file, the other file also has a generic grid.

File format : NetCDF4
-1 : Institut Source T Steptype Levels Num Points Num Dtype : Parameter ID
1 : unknown unknown c instant 12 1 16200 1 F32 : -1
Grid coordinates :
1 : generic : points=16200 (180x90)
lon : -179 to 179 by 2
lat : 89 to -89 by -2

RE: another "remapbil (Abort): Unsupported generic coordinates" question - Added by Karin Meier-Fleischer about 4 years ago

Hi Noam,

without the files I can only guess what you have to do.

Since the variable fractile has already a coordinates attribute you don't
have to add it anyway.

But the coordinate variables lon and lat have no units attribute and these
have to be added with ncatted.

ncatted -O -a units,lat,c,c,"degrees north" -a units,lon,c,c,"degrees east" frac.nc

Then it should look like

@netcdf frac {
dimensions:
patch = 12 ;
lon = 7200 ;
lat = 3600 ;
variables:
float patch(patch) ;
float lon(lon) ;
lon:units = "degrees_east" ;
float lat(lat) ;
lat:units = "degrees_north" ;
float fractile(patch, lat, lon) ;
fractile:_FillValue = 999.f ;
fractile:coordinates = "lon lat" ;

In your mygrid.nc file the variable LAI doesn't need to have a coordinates variable
because only the lon/lat grid is used. The units of lon and lat are missing here, too.

ncatted -O -a units,lat,c,c,"degrees north" -a units,lon,c,c,"degrees east" mygrid.nc

Now, remap the data:

cdo -remapbil,mygrid.nc frac.nc fracout.nc

-Karin

RE: another "remapbil (Abort): Unsupported generic coordinates" question - Added by Noam Chomsky about 4 years ago

That worked Karin, thank you! I have learned something. So is it normal for 'lonlat' coordinates type to be 'degrees_east circular' or should they just be 'degrees_east'?

RE: another "remapbil (Abort): Unsupported generic coordinates" question - Added by Karin Meier-Fleischer about 4 years ago

In general longitude and latitude coordinate variables should have units like "degrees_east"
(without circular) or "degrees_north". If you are interested in learning more about units see:
http://cfconventions.org/Data/cf-conventions/cf-conventions-1.7/build/ch03.html#units
;)

    (1-4/4)