Skip to content

Fix T_2M/TD_2M error by sourcing lead times 1–6 from previous INCA run#163

Merged
dnerini merged 8 commits into
mainfrom
MRB-876-shifted_runs
Jun 4, 2026
Merged

Fix T_2M/TD_2M error by sourcing lead times 1–6 from previous INCA run#163
dnerini merged 8 commits into
mainfrom
MRB-876-shifted_runs

Conversation

@teobuz
Copy link
Copy Markdown
Contributor

@teobuz teobuz commented May 26, 2026

The INCA runs in the archive have a known bug where T_2M and TD_2M are incorrect at lead times 1–6 for runs initialized at full hours. This PR works around it by loading those steps from the run 10 minutes prior (at :50), while keeping step 0 from the current reftime.

The fix applies only to hourly frequency and the two affected parameters. A helper _open_convert() was extracted to reduce duplication in the loading logic.

@teobuz teobuz requested a review from dnerini May 26, 2026 14:17
teobuz and others added 3 commits May 26, 2026 16:42
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dnerini dnerini changed the title introduced exeption for T_2M and TD_2M, use previous run for steps 1-6 Fix T_2M/TD_2M bias by sourcing lead times 1–6 from previous INCA run May 28, 2026
Comment on lines +440 to +441
elif u == "mm/h":
da = da.assign_attrs({**da.attrs, "units": "kg m-2"})
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this correct? We are converting from a rate to an accumulation. This particular conversion only works if values are for hourly accumulations. Is that always the case?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, good point, this work only for hourly accumulations, for 6h and 10min we have to do an additional conversion, I think it make sense to do it, so that we afterwards ready also for 10min accumulations. ANyway, we still have to compute the accumulations (now the algorithm just take the corresponding 10 min intensity). Probably make sense to open a new PR with accumulations and cooresponding units.

@dnerini dnerini changed the title Fix T_2M/TD_2M bias by sourcing lead times 1–6 from previous INCA run Fix T_2M/TD_2M error by sourcing lead times 1–6 from previous INCA run Jun 2, 2026
@dnerini dnerini merged commit c6d6cf2 into main Jun 4, 2026
4 of 5 checks passed
@dnerini dnerini deleted the MRB-876-shifted_runs branch June 4, 2026 13:07
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.

3 participants