Skip to content

Stage source INIUA into output dir before CO2 interpolation#48

Merged
JanStreffing merged 2 commits into
masterfrom
fix/iniua-co2-staging
Jun 29, 2026
Merged

Stage source INIUA into output dir before CO2 interpolation#48
JanStreffing merged 2 commits into
masterfrom
fix/iniua-co2-staging

Conversation

@JanStreffing

Copy link
Copy Markdown
Owner

Problem

Step 7 (3D CO2 interpolation) reads and writes the ICMGG…INIUA file at the output path (output/<exp>/openifs_input_modified/), but nothing ever copies the source INIUA from the input directory into the output dir — unlike the INIT file, which is staged via copy2() in process_land_sea_mask() (lsm.py).

As a result:

  • the CO2 read fails with FileNotFoundError,
  • the error is caught and merely printed (Error reading ICMGG file … No such file or directory),
  • the run still exits 0, and no CO2 is written into the INIUA.

This is silent — the pipeline reports success while the 3D CO2 field is missing from the regenerated INIUA.

Fix

  • Add OCPConfig.get_icmgg_iniua_input_file() returning the source INIUA path in openifs_default.
  • Copy the source INIUA into the output path immediately before Step 7, in both entry points (run_ocp_tool.py and ocp_tool/__main__.py). CO2 is then added in place (the writer reads all original messages into memory before opening the output for writing, so in-place is safe).

Verification

Re-ran run_ocp_tool.py configs/TCO95_CORE3.yaml:

  • Step 7 … Output GRIB file written … with 91 levels of CO2 data
  • OCP-Tool processing complete! (exit 0)
  • Regenerated ICMGGab45INIUA now contains 91 CO2 messages (level 1 verified at the expected concentration).

Step 7 (3D CO2 interpolation) read and wrote the INIUA file at the
output path, but nothing ever copied the source INIUA from the input
directory into the output dir -- unlike the INIT file, which is staged
in process_land_sea_mask() (lsm.py). As a result the CO2 read failed
with FileNotFoundError, the error was caught and merely printed, and
the run still exited 0 with no CO2 written into the INIUA.

Add config.get_icmgg_iniua_input_file() and copy the source INIUA into
the output path immediately before Step 7 in both entry points
(run_ocp_tool.py and ocp_tool/__main__.py). CO2 is then added in place.
@JanStreffing JanStreffing merged commit 0177fcd into master Jun 29, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant