1

I am trying remap interpolation using cdo by:

cdo remapbil,black_sea.mask.nc out.nc out_bs_mask.nc

I got this error:

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

I guess cdo does not handle with generic type. So, I tried to edit the mask file with "ncatted". But I couldn't remap this "generic" grid to a lonlat. I'd appreciate any suggestions with ncatted or any help.

The information of mask data: (grid coordinates=generic):

# gridID 1
#
gridtype  = generic
gridsize  = 22750
xsize     = 182
ysize     = 125
scanningMode = 64


netcdf black_sea.mask {
dimensions:
    y = 125 ;
    x = 182 ;
variables:
    double lon(y, x) ;
        lon:long_name = "easting of elevation points" ;
        lon:units = "degree" ;
        lon:coords = "east_e north_e" ;
    double mask(y, x) ;
        mask:long_name = "free surface mask" ;
        mask:units = "dimensionless" ;
        mask:coords = "east_e north_e" ;
    double lat(y, x) ;
        lat:long_name = "northing of elevation points" ;
        lat:units = "degree" ;
        lat:coords = "east_e north_e" ;

The information of output data from ISIMIP: (grid coordinates=lonlat):

    # gridID 1
#
gridtype  = lonlat
gridsize  = 64800
xsize     = 360
ysize     = 180
xname     = lon
xlongname = "Longitude"
xunits    = "degrees_east"
yname     = lat
ylongname = "Latitude"
yunits    = "degrees_north"
xfirst    = -179.5
xinc      = 1
yfirst    = 89.5
yinc      = -1
scanningMode = 64

    netcdf out {
dimensions:
    lat = 180 ;
    lon = 360 ;
    time = UNLIMITED ; // (2 currently)
variables:
    double lat(lat) ;
        lat:standard_name = "latitude" ;
        lat:long_name = "Latitude" ;
        lat:units = "degrees_north" ;
        lat:axis = "Y" ;
    double lon(lon) ;
        lon:standard_name = "longitude" ;
        lon:long_name = "Longitude" ;
        lon:units = "degrees_east" ;
        lon:axis = "X" ;
    double time(time) ;
        time:standard_name = "time" ;
        time:long_name = "Time axis" ;
        time:units = "months since 1601-1-1 00:00:00" ;
        time:calendar = "gregorian" ;
        time:axis = "T" ;
    float zmeso-vint(time, lat, lon) ;
        zmeso-vint:_FillValue = 1.e+20f ;
        zmeso-vint:missing_value = 1.e+20f ;
        zmeso-vint:standard_name = "mole_content_of_mesozooplankton_expressed_as_carbon_in_sea_water" ;
        zmeso-vint:long_name = "Mole Content of Mesozooplankton expressed as Carbon in sea water" ;
        zmeso-vint:units = "mol m-2" ;
        zmeso-vint:comment = "vertically integrated over all ocean levels by ISIMIP data management team" ;

I edited attributes for long_name,lat_name,and units to match with out.nc. However, I still have the same error.

rocinantes
  • 39
  • 4
  • Your question is slightly confusing. It sounds like you are trying to regrid the mask file to out.nc’s grid. Is that correct? If so, your CDO call is incorrect as it’s doing the opposite of what you intend – Robert Wilson Jul 22 '23 at 07:58
  • Hi, sorry for the confusion. No actually, I have been trying to interpolate and regrid out.nc (which is global) to my mask.nc file. – rocinantes Jul 22 '23 at 10:27

1 Answers1

0

Can you try adding attribute "standard_name" and replace units with degrees?

In any case, I am using grid setup like this for one of my applications and it worked with cdo:

enter image description here

msi_gerva
  • 2,021
  • 3
  • 22
  • 28