Project

General

Profile

remapbil Unsupported target grid

Added by Francesco Maicu almost 3 years ago

Dear CDO team,
I do not succeed in regridding a netcdf file to a different grid contained in another netcdf.

This is the ncdump of the file to be regridded :

dimensions:

time_counter = UNLIMITED ; // (1 currently)
y = 261 ;
x = 591 ;
depth = 1 ;

variables:

float nav_lon(y, x) ;

nav_lon:_FillValue = NaNf ;
nav_lon:long_name = "Longitude" ;
nav_lon:nav_model = "Default grid" ;
nav_lon:units = "degrees_east" ;

float nav_lat(y, x) ;

nav_lat:_FillValue = NaNf ;
nav_lat:long_name = "Latitude" ;
nav_lat:nav_model = "Default grid" ;
nav_lat:units = "degrees_north" ;

float deptht(depth) ;

deptht:_FillValue = NaNf ;
deptht:units = "meters" ;
deptht:long_name = "Depth" ;
deptht:nav_model = "Default grid" ;

float time_counter(time_counter) ;

time_counter:_FillValue = NaNf ;
time_counter:title = "Time" ;
time_counter:long_name = "Time axis" ;
time_counter:time_origin = "1900-01-01 00:00:00" ;
time_counter:units = "seconds since 1900-01-01" ;
time_counter:calendar = "noleap" ;

float Bathymetry(time_counter, y, x) ;

Bathymetry:_FillValue = NaNf ;
Bathymetry:units = "meters" ;
Bathymetry:title = "Bathymetry" ;
Bathymetry:long_name = "Bathymetry" ;

This is the ncdump of the file that contains the target grid :
dimensions:

y = 751 ;
x = 1657 ;

variables:

float lat(y) ;

lat:standard_name = "latitude" ;
lat:long_name = "Latitude" ;
lat:units = "degrees_north" ;

float lon(x) ;

lon:standard_name = "longitude" ;
lon:long_name = "Longitude" ;
lon:units = "degrees_east" ;

float Bathymetry(y, x) ;

Bathymetry:_FillValue = 9.96921e+36f ;
Bathymetry:units = "m" ;
Bathymetry:standard_name = "bathymetry" ;
Bathymetry:long_name = "Water depth" ;
Bathymetry:valid_min = 0.f ;
Bathymetry:valid_max = 5643.757f ;

This is command and the error messagge :
cdo remapbil,bathy_meter.nc bathy_bs-nrt_fullBox.nc bathy_bs-nrt_fullBox_remapped.nc

cdo remapbil (Abort): Unsupported target grid type (generic)!

I also tried defining this grid description file:

gridtype = lonlat
xsize = 1657
ysize = 751
xfirst = -24.000
yfirst = 25.0625
xinc = 0.041666666667
yinc = 0.041666666667

In this case I get:
cdo remapbil,grid_descr bathy_bs-nrt_fullBox.nc bathy_bs-nrt_fullBox_remapped.nc

cdo remapbil (Abort): Unsupported generic coordinates (Variable: nav_lon)!

PLease can anmyone give me a help?


Replies (2)

RE: remapbil Unsupported target grid - Added by Karin Meier-Fleischer almost 3 years ago

Hi Francesco,

without the data I can only guess that the missing coordinates attribute causes the problems.

You can use NCO's ncatted to add the coordinates attribute.

ncatted -O -a coordinates,Bathymetry,c,c,"nav_lat nav_lon" bathy_bs-nrt_fullBox.nc tmp.nc

cdo -remapbil,bathy_meter.nc tmp.nc bathy_bs-nrt_fullBox_remapped.nc

-Karin

RE: remapbil Unsupported target grid - Added by Francesco Maicu almost 3 years ago

Dear Karin,
thank you for your help, it worked!!
The coordinate attribute was also missing in the target grid, so I had to add also there.
Or more easily, using the grid_descr file.
Thank you very much!

    (1-2/2)