Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add range checking for fractions computed inside of CMEPS? #410

Open
ekluzek opened this issue Sep 19, 2023 · 1 comment
Open

Add range checking for fractions computed inside of CMEPS? #410

ekluzek opened this issue Sep 19, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@ekluzek
Copy link
Collaborator

ekluzek commented Sep 19, 2023

One of the reasons for issues #408 and #409 is that range checking is currently not being done for the fractions inside of CMEPS. Since, the ways that the fractions are computed is complex and could become incorrect it would be good to validate the range. This is also helpful when adding new grids to CMEPS where if it's out of range you know something is wrong. Otherwise, the model will run and you won't know about this issue unless you are able to look into it and figure it out. And figuring it out to a naive user is problematic and time-consuming.

The range for the fractions should be 0 to 1. But, allowing for some range within eps_fraclim would make sense. So something like this could be done.

if frac < eps_fraclim and frac > -eps_fraclim => frac = 0
if frac < 1+eps_fraclim and frac > 1-eps_fraclim => frac = 1
if frac < -eps_fraclim => abort
if frac > 1+eps_fraclim => abort

In some cases the truncation to zero is happening, but it would be good to make it consistent everywhere. The truncation changes would change answers so we'd need to be good with that, or else NOT add it in.

Note, this is the behavior that we had in the MCT coupler where range was checked for fractions and it would abort if out of range. I'm not sure if the truncation was done, but we could check.

@ekluzek ekluzek added the enhancement New feature or request label Sep 19, 2023
@ekluzek
Copy link
Collaborator Author

ekluzek commented Sep 20, 2023

MCT would only truncate for frac < 1.e-3 and frac > 1.e-2

It would fail for a eps_fraclim == 1.e-2

It also checked that the sum of the fractions (ocean, sea-ice, land) is 1 within 1.e-2 or trigger that as an error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant