Project

General

Profile

remaplaf generic grid

Added by Anne Moree over 1 year ago

Hello,

I am trying to regrid using remaplaf without succes. I think the attributes are unclear to CDO, but I do not know what it is missing.
The attached test file and its grid should have the info to make it possible to regrid.

cdo -L -remaplaf,r360x180 -setgrid,grid.nc test4.nc test5.nc 
cdo(1) setgrid: Process started
cdo    remaplaf (Abort): Unsupported generic coordinates (Variable: templvl)!
terminate called without an active exception
Aborted (core dumped)

What could I do?

Thank you in advance for your help,

Anne


Replies (3)

RE: remaplaf generic grid - Added by Ralf Mueller over 1 year ago

hi Anne!

The problem is that the coordinates for the data variable in 'test4.nc' need to be given in the coordinates attribute of the variable. Without this it's not clear, which of all the coordinates are the correct ones. The link between coordinates and their boundaries is not CF-conform IMO.

Possible fix:

  1. select the needed coordinates (here you have to decide the correct ones of course):
    cdo -setattribute,plon@axis='X',plat@axis='Y',plon@standard_name='longitude',plat@standard_name='latitude' -selname,plon,plat,pclon,pclat grid.nc pgrid.nc
  2. bring coordinates (which CDO at this moment regards as data variables) together with the original data:
    cdo merge test4.nc pgrid.nc ptest4.nc
  3. Link coordinate variables to the data variables and set the correct CF-conform attribute to the cell boundaries (needed to compute cell areas):
    cdo -setattribute,plon@bounds='pclon',plat@bounds='pclat',templvl@coordinates="plon plat" ptest4.nc pdata.nc
  4. Perform the remapping:
    cdo remaplaf,global_1 pdata.nc pdata_lonlat.nc

hth
ralf

RE: remaplaf generic grid - Added by Anne Moree over 1 year ago

Dear Ralf,

Thank you so much, this works exactly as wanted.

Cheers,
Anne

RE: remaplaf generic grid - Added by Ralf Mueller over 1 year ago

great to hear that ;-)

    (1-3/3)