Skip to content

Conversation

@lambert-p
Copy link
Contributor

@lambert-p lambert-p commented Sep 8, 2025

Addresses- EPPT-2571

Description

Create a plugin in IMPROVER to calculate precipitable water on pressure levels so it can be used it in the revised workflow design to calculate total precipitable water from the available StaGE data.

Plugin inputs: Humidity Mixing Ratio on pressure levels

Output: Precipitable water on pressure levels

Calculation:

The precipitable water on each pressure level is a function of the pressure difference across the vertical level and mean humidity mixing ratio in each level. We will assume that these values are represented by the input.

The pressure difference will be calculated from the linear mid-point between levels in Pascals. These values will form the bounds of the pressure coordinate on the output.

PW: Precipitable Water (m). q: Humidity mixing ratio (kg kg-1). ∆ p: Pressure difference (Pa == N m-2 == kg m-1 s-2). g: gravitational constant (9.91 m s-2). ρ: Water density constant (1000 kg m-3).

image

Testing:

  • Ran tests and they passed OK
  • Added new tests for the new feature(s)

@lambert-p lambert-p added the EPP PR's related to Enhancing Post Processing team label Sep 8, 2025
@lambert-p lambert-p self-assigned this Sep 8, 2025
Copy link
Contributor

@mo-philrelton mo-philrelton left a comment

Choose a reason for hiding this comment

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

This looks pretty good and produces correct looking data, but there are a few code improvments I think you should make.

Copy link
Contributor

@mo-philrelton mo-philrelton left a comment

Choose a reason for hiding this comment

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

Thanks for making those changes. I just have a couple more suggestions for you

@lambert-p
Copy link
Contributor Author

thank you for the comments @mo-philrelton I have made these changes.

mo-philrelton
mo-philrelton previously approved these changes Sep 18, 2025
Copy link
Contributor

@mo-philrelton mo-philrelton 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!

Copy link
Member

@MoseleyS MoseleyS left a comment

Choose a reason for hiding this comment

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

Thanks Phoebe. As discussed, there are a few things that I think could be simplified in this code which will make maintaining it in the future easier.

I also expected to see one or more unit tests testing that the inputs and outputs have specific data values, to help us catch unexpected consequences of future changes. Please can you add these.

@lambert-p
Copy link
Contributor Author

The plugin has been run in the workflow and succeeded. I have chosen a cube from this output and plotted it below:

image

Copy link
Contributor

@mo-robert-purvis mo-robert-purvis left a comment

Choose a reason for hiding this comment

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

The plugin interface works as expected - used in EPP workflow for TPW. The resulting cube is successfully manipulated for creating summed TPW. Tests look good.

Copy link
Member

@MoseleyS MoseleyS left a comment

Choose a reason for hiding this comment

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

Hi Phoebe. This is doing the right thing. My suggestions are now around making the code easier to understand.

@lambert-p
Copy link
Contributor Author

Thank you for the review @MoseleyS I have made the suggested changes.

MoseleyS
MoseleyS previously approved these changes Oct 7, 2025
Copy link
Member

@MoseleyS MoseleyS left a comment

Choose a reason for hiding this comment

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

Tests pass (on a branch simulating merging this PR into master).

Anzerkhan27
Anzerkhan27 previously approved these changes Oct 13, 2025
Copy link
Contributor

@Anzerkhan27 Anzerkhan27 left a comment

Choose a reason for hiding this comment

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

Tests verify the logic, units, and metadata.

@Anzerkhan27 Anzerkhan27 dismissed stale reviews from MoseleyS and themself via 6018cde October 14, 2025 10:26
Copy link
Member

@MoseleyS MoseleyS left a comment

Choose a reason for hiding this comment

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

Re-approving.

I have checked with Ben A and Carwyn P and we can safely ignore the missing codecov tests.

@cpelley cpelley merged commit 45c1097 into master Oct 14, 2025
5 checks passed
@cpelley
Copy link
Contributor

cpelley commented Oct 14, 2025

Bypassed rules in this case due to issues with the codecov currently.

@MoseleyS MoseleyS deleted the total_precipitable_water branch October 14, 2025 11:47
gavinevans added a commit to gavinevans/improver that referenced this pull request Oct 14, 2025
* upstream/master:
  Alter site filtering for site EMOS (metoppv#2201)
  Remove Anzer's name due to git merging behaviour. (metoppv#2212)
  Total Precipitable Water Plugin- EPPT 2571  (metoppv#2190)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

EPP PR's related to Enhancing Post Processing team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants