Skip to content

Conversation

@glwagner
Copy link
Member

@glwagner glwagner commented Nov 10, 2025

This PR unifies the saturation adjustment solver for the two thermodynamic states we support: MoistStaticEnergyState and PotentialTemperatureState. This is useful, because we now correctly set initial conditions in AtmosphereModel based on potential temperature input. This PR also fixes set!, which was wrong for moist initial states, and sets up an anelastic bomex case. I think we should work on actually running / validating the bomex case in a future PR.

@giordano
Copy link
Collaborator

Idea: move the scripts which are supposed to be "validation" proper (i.e. testing correctness, etc.) to a validation/ directory (or even have them as regular tests?), and keep in examples/ only scripts which are for showcasing how to use the package and how to get cool plots?

@glwagner
Copy link
Member Author

Idea: move the scripts which are supposed to be "validation" proper (i.e. testing correctness, etc.) to a validation/ directory (or even have them as regular tests?), and keep in examples/ only scripts which are for showcasing how to use the package and how to get cool plots?

Yes let's! Possibly, we can just convert the bomex case to an example and remove the Validation workflow (at least for now). We can reinstate the validation workflow in the future. Possibly, we want to combine "validation" and "regression" (eg the regression tests will just run cases that we have used for validation, which are the highest priority cases that we want to ensure keep working exactly as designed).

@glwagner glwagner changed the title Use AtmosphereModel for bomex case Unified adjustment solver for MoistStaticEnergyState and PotentialTemperatureState + atmos bomex case Nov 10, 2025
@codecov
Copy link

codecov bot commented Nov 10, 2025

Codecov Report

❌ Patch coverage is 98.42520% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/AtmosphereModels/set_atmosphere_model.jl 95.23% 1 Missing ⚠️
.../AtmosphereModels/update_atmosphere_model_state.jl 90.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

= q.liquid
qⁱ = q.ice

@inbounds energy_density[i, j, k] = ρᵣ * (cᵖᵐ * T + g * z - ℒˡᵣ *- ℒⁱᵣ * qⁱ)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Deduct latent heat here??

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, this is a specific form of the moist static energy... we don't have a derivation of it in the docs yet but I believe it is correct. Similar to the idea of the liquid-ice potential temperature, the more liquid or ice is present, the higher T is

Comment on lines -171 to 178
Gⁿ = model.timestepper.Gⁿ
Gⁿ = model.timestepper.Gⁿ
arch = model.architecture
Copy link
Collaborator

Choose a reason for hiding this comment

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

You're converting to Runic style already? 👀

Copy link
Member Author

Choose a reason for hiding this comment

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

😂

@glwagner glwagner merged commit ed13ce4 into main Nov 11, 2025
10 checks passed
@glwagner glwagner deleted the glw/atmos-bomex branch November 11, 2025 01:56
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.

4 participants