Stage source INIUA into output dir before CO2 interpolation#48
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Step 7 (3D CO2 interpolation) reads and writes the
ICMGG…INIUAfile 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 viacopy2()inprocess_land_sea_mask()(lsm.py).As a result:
FileNotFoundError,Error reading ICMGG file … No such file or directory),This is silent — the pipeline reports success while the 3D CO2 field is missing from the regenerated INIUA.
Fix
OCPConfig.get_icmgg_iniua_input_file()returning the source INIUA path inopenifs_default.run_ocp_tool.pyandocp_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 dataOCP-Tool processing complete!(exit 0)ICMGGab45INIUAnow contains 91 CO2 messages (level 1 verified at the expected concentration).