Error creating area weights for pre-operational ICON-D2
Added by Stefan Ochs over 4 years ago
I use CDO 1.9.3 and eccodes 2.6.0 on Ubuntu 18.04.5 LTS.
I want to create an area weights file for the pre-operational ICON-D2. I use the files icon_grid_0047_R19B07_L.nc.bz2 and target_grid_icon_d2_002.txt from the page [[https://www.dwd.de/DE/leistungen/opendata/neuigkeiten/opendata_aug2020_01.html]].
But when I run
cdo gennn,target_grid_icon_d2_002.txt icon_grid_0047_R19B07_L.nc out_weights.nc
I get the following error:
cdo gennn (Abort): Reference to source grid not found!
I have got the command from the DWD description [[https://www.dwd.de/DE/leistungen/opendata/help/modelle/Opendata_cdo_EN.pdf?__blob=publicationFile&v=3]].
With the ICON global file icon_grid_0026_R03B07_G.nc there is no error.
Any idea?
Thanks,
Stefan
Replies (5)
RE: Error creating area weights for pre-operational ICON-D2 - Added by Ralf Mueller over 4 years ago
I cannot find the target_grid_icon_d2_002.txt
on the dwd page - could you upload it here, please?
cheers
ralf
RE: Error creating area weights for pre-operational ICON-D2 - Added by Stefan Ochs over 4 years ago
It is in
[[https://opendata.dwd.de/weather/lib/cdo/ICON_D2_002_EASY.tar.bz2]]
Despite the name it is a pure tar file, not a bz2 file.
This link can be found in [[https://www.dwd.de/DE/leistungen/opendata/neuigkeiten/opendata_aug2020_01.html]].
BR,
Stefan
RE: Error creating area weights for pre-operational ICON-D2 - Added by Ralf Mueller over 4 years ago
The reason is the grid numbering in the grid file: Each gridfile not only hast the cell grid of ICON but also the edge and vertex grid. Unfortunately the ordering is different
- in
icon_grid_0026_R03B07_G.nc
the cell grid is the first one - in
icon_grid_0047_R19B07_L.nc
is is the second one
By default gennn (and all other related operators) take the first grid in the grid file for computing the interpolation weights. Hence you have to select the second one to succeed:
$ cdo gennn,target_grid_icon_d2_002.txt -selgrid,1 icon_grid_0047_R19B07_L.nc out_weights.nc cdo(1) selgrid: Process started cdo gennn (Abort): Reference to source grid not found! terminate called without an active exception zsh: abort (core dumped) cdo gennn,target_grid_icon_d2_002.txt -selgrid,1 icon_grid_0047_R19B07_L.nc $ cdo gennn,target_grid_icon_d2_002.txt -selgrid,2 icon_grid_0047_R19B07_L.nc out_weights.nc cdo(1) selgrid: Process started cdo gennn: Nearest neighbor weights from unstructured (542040) to lonlat (1214x745) grid cdo(1) selgrid: Processed 34 variables over 1 timestep. cdo gennn: Processed 542040 values from 1 variable over 1 timestep [0.94s 312MB].
In order to be more independent of the ordering, you could select a variable which is clearly related to the cell grid (in case you want the cell grid):
cell_area
. The corresponding command is:cdo gennn,target_grid_icon_d2_002.txt -selname,cell_area icon_grid_0047_R19B07_L.nc out_weights.nc
hth
ralf
RE: Error creating area weights for pre-operational ICON-D2 - Added by Stefan Ochs over 4 years ago
That helped indeed, thank you. But now I encounter the next problem.
I have created the file out_wights.nc. When I try to use this file for regridding, I get the following error:
cdo -f grb2 remap,target_grid_icon_d2_002.txt,out_weights.nc icon-d2_germany_icosahedral_single-level_2020080412_008_2d_t_2m.grib2 out.grib2
cdo remap (Warning): Reference to horizontal grid not available!
cdo remap (Abort): Reference to source grid not found!
When I take the DWD weights file from ICON_D2_002_EASY.tar.bz2 then there is no error:
cdo -f grb2 remap,target_grid_icon_d2_002.txt,weights_icon_d2_002.nc icon-d2_germany_icosahedral_single-level_2020080412_008_2d_t_2m.grib2 out.grib2
cdo remap: Processed 542040 values from 1 variable over 1 timestep [0.27s 156MB]
So although I used the target grid description file from DWD, my self-generated weights file out_wights.nc is obviously not equivalent to the file weights_icon_d2_002.nc from DWD.
In the next step I wanted to use a new grid description file with a lower resolution and a smaller area. But as long as the original file target_grid_icon_d2_002.txt does not work, this makes no sense.
In the beginning I started with the DWD "Guideline for the transformation of GRIB2 datasets from the original triangular to the regular lat/lon grid". Everything looked so easy there. But unfortunately it does not work this way for the new ICON-D2 files.
RE: Error creating area weights for pre-operational ICON-D2 - Added by Stefan Ochs over 4 years ago
With support from DWD: The right commands for me are
cdo -selgrid,2 icon_grid_0047_R19B07_L.nc icon_d2_grid.nc
cdo gennn,icon-d2_description.txt -setgrid,icon_d2_grid.nc icon-d2_sample.grib2 out_weights.nc