Skip to content

Adds saturation fraction#2149

Open
David Flack (daflack) wants to merge 10 commits into
mainfrom
1965_saturation_fraction
Open

Adds saturation fraction#2149
David Flack (daflack) wants to merge 10 commits into
mainfrom
1965_saturation_fraction

Conversation

@daflack
Copy link
Copy Markdown
Collaborator

@daflack David Flack (daflack) commented May 19, 2026

Also includes operators for precipitable water and saturation precipitable water as needed within saturation fraction code.

Fixes #1965

Contribution checklist

Aim to have all relevant checks ticked off before merging. See the developer's guide for more detail.

  • Documentation has been updated to reflect change.
  • New code has tests, and affected old tests have been updated.
  • All tests and CI checks pass.
  • Ensured the pull request title is descriptive.
  • Ensure rose-suite.conf.example has been updated if new diagnostic added.
  • Conda lock files have been updated if dependencies have changed.
  • Attributed any Generative AI, such as GitHub Copilot, used in this PR.
  • Marked the PR as ready to review.

@daflack David Flack (daflack) self-assigned this May 19, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 19, 2026

Coverage

Copy link
Copy Markdown
Contributor

@jwarner8 James Warner (jwarner8) left a comment

Choose a reason for hiding this comment

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

Looks good, a few small queries/clarifications.

# (following trapezoid rule).
pw = np.trapezoid(
w.data,
x=w.coord("level_height").points[:],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does model always use "level_height" as coordinate name for model levels? Realise this is for the UM, with LFRic data needing to be fixed to include this auxilliary coordinate alongside model_level_number.

)
# Determine array information of input cube to get
# correct cube to copy across to.
if len(w.coord("realization").points) != 1 and len(w.coord("time").points) != 1:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

are we making assumptions of the cube structure/how dimensions are ordered?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think there is some code somewhere in CSET which returns the axis names and which index they are. It might be in one of Huw's merged branches. If we do assume a structure, be good to be clear about this in code in comments so easier to debug later on


It can be calculated as

.. math:: spw = frac{1}{\rho_w} \int \frac{w}{RH} dz
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

any ref/book citation we can use to ground this?


and can be used throughout the globe with the same interpretation.

For a recent, example, [Daviesetal2026]_ have applied the concept to their
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
For a recent, example, [Daviesetal2026]_ have applied the concept to their
For a recent example, [Daviesetal2026]_ have applied the concept to their

precipitable water are derived, before their ratios are taken for the
saturation fraction.

A saturation fraction close to one implies that the atmopshere is fully
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
A saturation fraction close to one implies that the atmopshere is fully
A saturation fraction close to one implies that the atmosphere is fully

operator: constraints.combine_constraints
constraint_1:
operator: constraints.generate_var_constraint
varname: "m01s00i408"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

will this work on LFRic data as it wont have STASH attributes?

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.

Saturation Fraction operator

2 participants