Project

General

Profile

Remapbil (Abort): Unsupported Error

Added by nazanin tavakoli 6 months ago

Hello,
I have a NetCDF file with 0.25-degree resolution that has four dimensions called "(time,bnds,lon, lat)" and two variables called "time_bnds, precipitation". I want to do re-griding. The first data has the following information:
lat: -50:49.75
lon:-180:179.8
The new re-gridded file should have (lat: -50.5:50.5, lon:-179.5:179.5)
The gridfile.txt is:

gridtype = lonlat
gridsize = 36720
xname = longitude
xlongname = longitude
xunits = degrees_east
yname = latitude
ylongname = latitude
yunits = degrees_north
xsize =360
ysize =102
xfirst =-179.5
xinc = 1
yfirst =-50.5
yinc = 1

But there is an error:
cdo remapbil,gridfile.txt TRMM_precip_daily.nc TRMM_precip_daily_G.nc

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

How can I fix it?


Replies (10)

RE: Remapbil (Abort): Unsupported Error - Added by Karin Meier-Fleischer 6 months ago

Hi Nazanin,

can you show us the output of 'ncdump -h' of the 'first file' or maybe upload only one timestep?

RE: Remapbil (Abort): Unsupported Error - Added by nazanin tavakoli 6 months ago

Hi, these are the information:

Global attributes: {'CDI': 'Climate Data Interface version 1.9.10 (https://mpimet.mpg.de/cdi)', 'Conventions': 'CF-1.6', 'frequency': 'day', 'history': 'Tue Sep 26 09:50:05 2023: cdo daymean TRMM_precip_all_3hrly.nc TRMM_precip_daily.nc', 'CDO': 'Climate Data Operators version 1.9.10 (https://mpimet.mpg.de/cdo)'}

Dimensions:
<class 'netCDF4._netCDF4.Dimension'> (unlimited): name = 'time', size = 7121
<class 'netCDF4._netCDF4.Dimension'>: name = 'bnds', size = 2
<class 'netCDF4._netCDF4.Dimension'>: name = 'lon', size = 1440
<class 'netCDF4._netCDF4.Dimension'>: name = 'lat', size = 400

Variables:
<class 'netCDF4._netCDF4.Variable'>
float64 time(time)
standard_name: time
bounds: time_bnds
units: hours since 1998-01-01 00:00:00
calendar: proleptic_gregorian
axis: T
unlimited dimensions: time
current shape = (7121,)
filling off
<class 'netCDF4._netCDF4.Variable'>
float64 time_bnds(time, bnds)
unlimited dimensions: time
current shape = (7121, 2)
filling off
<class 'netCDF4._netCDF4.Variable'>
float64 lon(lon)
axis: X
unlimited dimensions:
current shape = (1440,)
filling off
<class 'netCDF4._netCDF4.Variable'>
float64 lat(lat)
axis: Y
unlimited dimensions:
current shape = (400,)
filling off
<class 'netCDF4._netCDF4.Variable'>
float64 precipitation(time, lat, lon)
_FillValue: nan
missing_value: nan
cell_methods: time: mean
unlimited dimensions: time
current shape = (7121, 400, 1440)
filling off

RE: Remapbil (Abort): Unsupported Error - Added by Karin Meier-Fleischer 6 months ago

The units attribute for lon and lat are missing. Add it with NCO's ncatted:

ncatted -O -a units,lon,c,c,"degrees_east" units,lat,c,c,"degrees_north" infile.nc

RE: Remapbil (Abort): Unsupported Error - Added by nazanin tavakoli 6 months ago

Thanks, the following code worked for me:

ncatted -O -a units,lon,c,c,"degrees_east" -a units,lat,c,c,"degrees_north" TRMM_precip_daily.nc

RE: Remapbil (Abort): Unsupported Error - Added by nazanin tavakoli 6 months ago

I have another question. I have two netcdf files. One has a longitude that starts from 0.5 to 395.5 with a resolution of 1 degree. The other one has a longitude from -180 to 179.8 with 0.25 resolution. How can I re-grid the second one to the first one since the first points are different?

Nazanin

RE: Remapbil (Abort): Unsupported Error - Added by Karin Meier-Fleischer 6 months ago

You can use the grid of the first netCDF file for remapping.

For example:

infile1.nc: 1.0 degree resolution
infile2.nc: 0.25 degree resolution

cdo -remapbil,infile1.nc infile2.nc infile2_on_grid1.nc

RE: Remapbil (Abort): Unsupported Error - Added by nazanin tavakoli 6 months ago

I used the following code:
cdo -remapbil,prate_daily_198007.nc TRMM_precip_daily.nc TRMM_precip_daily_G.nc
but I got this error:
Illegal instruction (core dumped)

Can you help me?

RE: Remapbil (Abort): Unsupported Error - Added by nazanin tavakoli 6 months ago

Unfortunately, I cannot upload it here because it is too large.

RE: Remapbil (Abort): Unsupported Error - Added by Karin Meier-Fleischer 5 months ago

Is only one timestep of prate_daily_198007.nc and TRMM_precip_daily.nc also too large?

Ok, let's see what could it be (just guessing).

Does the prate_daily_198007.nc file contain multiple grids for various variables inside?
Does the TRMM_precip_daily.nc file contain multiple grids for various variables inside?

You can try to go this way:
- Select one variable in prate_daily_198007.nc that is on the target grid you want to remap to.

     cdo -selname,variable prate_daily_198007.nc target_grid.nc

- Do the remapping

     cdo -remapbil,target_grid.nc TRMM_precip_daily.nc TRMM_precip_daily_remapped.nc

- If this fails try to select a variable from TRMM_precip_daily.nc and do the remapping:

    cdo -remapbil,target_grid.nc -selname,your_variable TRMM_precip_daily.nc TRMM_precip_daily_remapped.nc

    (1-10/10)