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

Make precipitation part of the working fluid #3536

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

trontrytel
Copy link
Member

No description provided.

@trontrytel trontrytel force-pushed the aj/working_fluid branch 2 times, most recently from 0a1d8d0 to 6aedeac Compare January 23, 2025 23:27
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 only looked at changes to grid-mean now and they look good, thanks! Could you double check it still makes sense when we use TD.relative_humidity and TD.vol_vapor_mixing_ratio in the code? They should be mostly in radiation callback and diagnostics.

Comment on lines +68 to +72
ifelse(
p.precomputed.ᶜspecific.q_liq + p.precomputed.ᶜspecific.q_ice > 0,
1,
0,
),
Copy link
Member

Choose a reason for hiding this comment

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

Do we have an has_condensate for non-equilibrium thermo state?

Copy link
Member Author

Choose a reason for hiding this comment

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

We do. However if would return true for a case where hypothetically q_liq=0 but q_rai!=0. I wanted to avoid that problem, so I do it by hand with the specific precomputed values

Comment on lines +242 to +243
q_rai,
q_sno,
Copy link
Member

Choose a reason for hiding this comment

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

Just note that these could be negative.

Copy link
Member Author

Choose a reason for hiding this comment

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

That should be fine. I'll double check just in case but all microphysics functions return zero if one of the tracers is negative. And all the limiters inside ClimaAtmos precipitation are written anticipating tracers can be negative too. No trust!

@trontrytel
Copy link
Member Author

I only looked at changes to grid-mean now and they look good, thanks! Could you double check it still makes sense when we use TD.relative_humidity and TD.vol_vapor_mixing_ratio in the code? They should be mostly in radiation callback and diagnostics.

Water vapor related things should be fine since q_vap = q_tot - q_liq - q_ice from PhasePartition. So whether q_liq/ice contain just the cloud condensate stuff in the equil case or also contain precipitation in the nonequil case the resulting q_vap is fine.

I'm not so sure about some other thermodynamics functions. Like, do we want out potential temperature to now also contain precipitation contribution? This kind of ties back to the buoyancy gradients too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants