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

Clip effective radius between the values from the lookup table #568

Merged
merged 1 commit into from
Feb 11, 2025

Conversation

trontrytel
Copy link
Member

I need to start modeling cloud effective radius in the Atmos Model. The RRTMGP lookup table logic breaks for cases when the effective radius is outside the lookup table range. More specifically I can get a negative loc when I set the effective radius to zero outside of clouds.

A fast workaround for that is to clip the effective radius to be between the lookup table values. This fixes my problems in this PR: CliMA/ClimaAtmos.jl#3620

@trontrytel trontrytel self-assigned this Feb 11, 2025
@sriharshakandala
Copy link
Member

sriharshakandala commented Feb 11, 2025

Hi @trontrytel ,
As discussed, the best way to do this is to check if this variable falls within the covered range upstream and stop the simulation if values are out of covered range.
If you intend to clamp to the extrema of the covered range temporarily, this is ok, but I believe this needs to be eventually replaced.
cc: @szy21

@sriharshakandala
Copy link
Member

Please check on the Downstream test failures, squash commits, rebase, as needed.
cc: @nefrathenrici

@sriharshakandala
Copy link
Member

sriharshakandala commented Feb 11, 2025

Also, as discussed, setting cloud fraction to zero is recommended way to turn off cloud optics at any given layer! For example, if r_eff is too small, the cloud fraction can be set to zero at the layer!

Copy link
Member

@szy21 szy21 left a comment

Choose a reason for hiding this comment

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

I think this is fine as a temporary fix. Let's add a todo in the code comment to move it to ClimaAtmos, and open an issue in ClimaAtmos. It should be straightforward to clip it in ClimaAtmos with RRTMGP lookup table information. We can do it when we have more time after the current milestones are finished.

It is physical to have effective radius outside of the range. We shouldn't stop the simulation. We can think if there is a better way to extrapolate in the future.

@trontrytel
Copy link
Member Author

We should not stop the simulation if we get effective radius values outside the lookup table range. Those can still be physical values. I also don't think that we should set the cloud fraction to zero based on effective radius, if we have cloud condensate available.

The lookup table range is an RRTMGP issue. I would prefer if RRTMGP had a defined behavior for how to handle cases outside of it's range. For example by clipping to the range edges as proposed here. I'm ok to move it into Atmos if you guys think this is safer. Ideally after we are done with the most urgent milestones.

The Downstream test has been broken before. It looks like it requires an Atmos release. Which I will do after the RRTMGP update. So I'll merge this in now as is and follow up after the Atmos release

@trontrytel trontrytel enabled auto-merge February 11, 2025 19:40
@trontrytel trontrytel merged commit ed0dca5 into main Feb 11, 2025
9 of 11 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.

3 participants