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

Adding nonequilibrium parameterization to EDMF #3518

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

Conversation

oalcabes
Copy link

Purpose

To-do

Content


  • I have read and checked the items on the review checklist.

@oalcabes oalcabes closed this Jan 13, 2025
@oalcabes oalcabes reopened this Jan 15, 2025
@oalcabes oalcabes marked this pull request as draft January 15, 2025 22:58
@oalcabes oalcabes marked this pull request as ready for review January 17, 2025 17:43
Comment on lines +70 to +71
ᶜq_liq⁰ = similar(Y.c, FT),
ᶜq_ice⁰ = similar(Y.c, FT),
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
ᶜq_liq⁰ = similar(Y.c, FT),
ᶜq_ice⁰ = similar(Y.c, FT),

Can we instead compute these on the fly?

Comment on lines +94 to +114
@. ᶜq_tot⁰ = divide_by_ρa(
Y.c.ρq_tot - ρaq_tot⁺(Y.c.sgsʲs),
ᶜρa⁰,
Y.c.ρq_tot,
Y.c.ρ,
turbconv_model,
)
@. ᶜq_liq⁰ = divide_by_ρa(
Y.c.ρq_liq - ρaq_liq⁺(Y.c.sgsʲs),
ᶜρa⁰,
Y.c.ρq_liq,
Y.c.ρ,
turbconv_model,
)
@. ᶜq_ice⁰ = divide_by_ρa(
Y.c.ρq_ice - ρaq_ice⁺(Y.c.sgsʲs),
ᶜρa⁰,
Y.c.ρq_ice,
Y.c.ρ,
turbconv_model,
)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
@. ᶜq_tot⁰ = divide_by_ρa(
Y.c.ρq_tot - ρaq_tot⁺(Y.c.sgsʲs),
ᶜρa⁰,
Y.c.ρq_tot,
Y.c.ρ,
turbconv_model,
)
@. ᶜq_liq⁰ = divide_by_ρa(
Y.c.ρq_liq - ρaq_liq⁺(Y.c.sgsʲs),
ᶜρa⁰,
Y.c.ρq_liq,
Y.c.ρ,
turbconv_model,
)
@. ᶜq_ice⁰ = divide_by_ρa(
Y.c.ρq_ice - ρaq_ice⁺(Y.c.sgsʲs),
ᶜρa⁰,
Y.c.ρq_ice,
Y.c.ρ,
turbconv_model,
)

thermo_params,
ᶜp,
ᶜmse⁰ - ᶜΦ,
TD.PhasePartition.(ᶜq_tot⁰, ᶜq_liq⁰, ᶜq_ice⁰),
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
TD.PhasePartition.(ᶜq_tot⁰, ᶜq_liq⁰, ᶜq_ice⁰),
nonequil_phase_part(ᶜts, Y.c.sgsʲs, ᶜρa⁰, Y.c.ρ, turbconv_model),

and somewhere in the module we can define:

nonequil_phase_part(ts, sgsʲs, ᶜρa⁰, ρ, turbconv_model) =
    nonequil_phase_part(
        ρ * TD.total_specific_humidity(ts),
        ρ * TD.liquid_specific_humidity(ts),
        ρ * TD.ice_specific_humidity(ts),
        sgsʲs, ᶜρa⁰, ρ, turbconv_model
    )
function nonequil_phase_part(ρq_tot, ρq_liq, ρq_ice, sgsʲs, ᶜρa⁰, ρ, turbconv_model)
    q_tot = divide_by_ρa(
        ρq_tot - ρaq_tot⁺(sgsʲs),
        ᶜρa⁰,
        ρq_tot,
        ρ,
        turbconv_model,
    )
    q_liq = divide_by_ρa(
        ρq_liq - ρaq_liq⁺(sgsʲs),
        ᶜρa⁰,
        ρq_liq,
        ρ,
        turbconv_model,
    )
    q_ice = divide_by_ρa(
        ρq_ice - ρaq_ice⁺(sgsʲs),
        ᶜρa⁰,
        ρq_ice,
        ρ,
        turbconv_model,
    )
return TD.PhasePartition(q_tot, q_liq, q_ice)
end

@trontrytel
Copy link
Member

Thank you! FYI we have decided to only support 0M + equilibrium or 1M non-equilibrium. I'll try to quickly go through the code we currently have to reflect that change and then look at this PR

@trontrytel
Copy link
Member

I'm thinking of putting q_rai and q_sno inside the edmf sub-domains to have simplify the constructor logic. Stay tuned

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.

4 participants