Skip to content

Frozen precip corrector via clipping#1305

Open
Arcomano1234 wants to merge 12 commits into
mainfrom
feature/frozen-precip-corrector
Open

Frozen precip corrector via clipping#1305
Arcomano1234 wants to merge 12 commits into
mainfrom
feature/frozen-precip-corrector

Conversation

@Arcomano1234

@Arcomano1234 Arcomano1234 commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

ACE can produce frozen precipitation (total_frozen_precipitation_rate) exceeding the total precipitation rate (PRATEsfc), which is unphysical since frozen precipitation is a component of total precipitation. This PR clips frozen precipitation to the total precipitation rate (downstream of the correctors that can change PRATEsfc), but upstream of the energy correctors which utilizes total_frozen_precipitation_rate.

Here is the impact of the correctors show as the fraction of PRATEsfc that is frozen precipitation
image
For more analysis see this notebook.

Changes:

  • fme.core.corrector.atmosphere.MoistureBudgetCorrection: after closing the moisture budget, clip total_frozen_precipitation_rate to the corrected PRATEsfc when frozen precipitation is predicted. This runs before any total-energy-budget correction, since frozen precipitation contributes to the surface energy flux via the latent heat of freezing.

  • fme.core.atmosphere_data.AtmosphereData: add a set_frozen_precipitation_rate setter to support the clip.

  • Tests added

Resolves #1269

@Arcomano1234 Arcomano1234 changed the title Frozen precip correctors [WIP] Frozen precip corrector via clipping Jul 9, 2026
@mcgibbon

Copy link
Copy Markdown
Contributor

With the corrector we're strongly under-predicting non/zero-one values and over-predicting the edge values. I think for this task we particularly want to propagate gradients through the clip. It would be nice to see what that does to the result, before we use it (but I don't think blocks review/merge of the feature).

@mcgibbon mcgibbon self-requested a review July 10, 2026 16:23
@Arcomano1234

Copy link
Copy Markdown
Contributor Author

With the corrector we're strongly under-predicting non/zero-one values and over-predicting the edge values. I think for this task we particularly want to propagate gradients through the clip. It would be nice to see what that does to the result, before we use it (but I don't think blocks review/merge of the feature).

Considering I need to re-run the baseline training I will re-run this training with the propagate gradients through the clip feature one to see how much this makes a difference.

# Clip frozen precipitation against the (possibly corrected) total
# precipitation rate. Done here, after the budget correction, so the
# ceiling is the final precipitation rate.
frozen_clip = _clip_frozen_precipitation({**gen_data, **corrected})

@brianhenn brianhenn Jul 10, 2026

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.

I don't have strong opinions either way, but as implemented this changes the behavior of existing steppers (probably not that many of them out there that predict frozen precipitation still). An alternative would be to have this off by default (and maybe then explicitly turn it on in the baseline config). Not sure if the extra config arg is really worth it or not.

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.

Yeah that was what I previous had but I can't imagine anyone would want this off even for old check points. Right now only ACE-SHiELD+ is a public ckpt with frozen precip.

@spencerkclark is it possible for you to run this feature with your ACE-SHiELD+ ckpt. If you can just run a 10 day forecast saving PRATEsfc and total_frozen_precip with and without this feature, I can run it through my notebook. I suspect that this feature will actually help your fraction_of_precip_that_is_frozen without even needing to retrain but I also want to confirm it. What I did just realize is this will affect the model behavior as this happens before the energy correctors (and thus can affect the model evolution) so we should confirm this doesn't break your ckpt. Can you also run a 1000 year simulation with this (you shouldn't have to save any output)?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, yes, I agree this is important to take a look at. I'll run the experiments you suggest and maybe a couple others.

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.

Total frozen precipitation is currently unconstrained

4 participants