ARPA-SIMC / eccodes-simc

custom grib definitions and samples for ARPAE-SIMC
Apache License 2.0
1 stars 0 forks source link

Unable to write UTM grid #10

Closed dcesari closed 1 year ago

dcesari commented 2 years ago

Somewhere between eccodes v 2.14 and 2.25, in section.3.def the following lines appeared:

if (gridDefinitionTemplateNumber >= 32768) {
  template gridDefinitionSection "grib2/local/[centreForLocal]/template.3.[gridDefinitionTemplateNumber:l].def";
} else {
  template gridDefinitionSection "grib2/template.3.[gridDefinitionTemplateNumber:l].def";
}

this means that our UTM projection, template 32768 is interpreted as the first of local grid templates and it is not possible to code it since eccodes looks for e.g. grib2/local/cnmc/template.3.32768.def (if centre==80).

Alternative proposals:

  1. patch that line of section.3.def to >=32769
  2. change template for UTM to 32767
  3. make template.3.32768.def a local template and move it to the subdirectories of the desired centres (80, 200).

The third solution is probably cleaner, however we must make the patch eccodes version-dependent as in #9.

dcesari commented 2 years ago

This turned out to be a detailed duplicate of #8 and the reason for https://github.com/ARPA-SIMC/arkimet/issues/290

dcesari commented 2 years ago

The issue in principle is solved, I keep it open in case we would like to discuss a more general/reliable solution than 625c4b9926baa0e74fad1c081ffe761ff4277467.

dcesari commented 1 year ago

This problem reappeared in the python patcher version, fixed by 3c2355f

edigiacomo commented 1 year ago

Commit 3c2355f was released in version 0.6-1, can we close this issue?