Project

General

Profile

Conservative remapping of curvilinear grid

Added by Pascale Maier 8 days ago

Dear all,
I am a newbie to cdo and remapping, and I am sure there is an easy solution for my problem that I just don’t know (so many thanks in advance!).
I need to remap the precipitation data from HYRAS from DWD (https://opendata.dwd.de/climate_environment/CDC/grids_germany/daily/hyras_de/precipitation/) to UTM32. This is the grid I used for bilinear remapping of HYRAS temperature data:

The bilinear remapping of the temperature data was not a problem, but I would like to use remapcon for the precipitation datasets. I am currently using cdo Version 2.3.0.
I tried to set dimension of the variable to x and y and remove lon and lat coordinates to avoid any trouble, but I am not able to successfully remap my precipitation data.

I assume that the problem is due to the definition of the bounds? I added the output of cdo sinfon and ncdump -h pr_hyras_1_2025_v6-1_de.nc | grep bnds.

I would be very helpful for any tips, if it is possible to get that curvilinear grid to UTM32.
Thank you very much! Please let me know if you need any more information.

Kind regards,
Pascale


Replies (3)

RE: Conservative remapping of curvilinear grid - Added by Karin Meier-Fleischer 8 days ago

I guess you have to use remapnn instead because remapcon always returns an error even if you remove the geographic coordinates as described in https://code.mpimet.mpg.de/boards/1/topics/14358

Warning: longitude bounds out of range, skipped!
Warning: latitude bounds out of range, skipped!

cdo remapcon (Abort): Source grid cell corner coordinates missing!

RE: Conservative remapping of curvilinear grid - Added by Pascale Maier 8 days ago

And that is only the case for curvilinear grids, right? Because for other data like polar stereographic RADKLIM data, my approach works absolutely fine.

RE: Conservative remapping of curvilinear grid - Added by Uwe Schulzweida 7 days ago

You can remove the geographical coordinates using the environment variable IGNORE_ATT_COORDINATES=1. In this case, these coordinates and the bounds will be recalculated from the projection attribute if necessary.
Unfortunately, this does not work with the current attribute, as the proj library does not accept the ‘+type=crs’ parameter.

proj4_params="+proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs +type=crs" 
The parameter "+type=crs" must therefore be removed. Here is a solution with CDO:
IGNORE_ATT_COORDINATES=1 cdo  remapcon,<targetgrid> -setprojparams,'+proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000 +ellps=GRS80 +units=m +no_defs' infile outfile

    (1-3/3)