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

Add reasonable conversion from z to pressure #158

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

ph-kev
Copy link
Member

@ph-kev ph-kev commented Nov 8, 2024

closes #157 - This commit adds a reasonable conversion from z to pressure by finding the target pressure by using the mapping p(z) = P0 * exp(-z / H_EARTH), where P0 = 10000 and H_EARTH = 7000.0.

Copy link

codecov bot commented Nov 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.32%. Comparing base (1120fdf) to head (27f4413).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #158   +/-   ##
=======================================
  Coverage   98.31%   98.32%           
=======================================
  Files          11       11           
  Lines        1188     1191    +3     
=======================================
+ Hits         1168     1171    +3     
  Misses         20       20           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

NEWS.md Outdated
Comment on lines 31 to 33
- `Atmos.to_pressure_coordinates` now uses reasonable pressure values when `target_pressure`
is not specified. In particular, the vertical dimension is mapped to pressure levels by
z -> P0 * exp(-z / H_EARTH), where P0 = 10000 and H_EARTH = 7000.0.
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
- `Atmos.to_pressure_coordinates` now uses reasonable pressure values when `target_pressure`
is not specified. In particular, the vertical dimension is mapped to pressure levels by
z -> P0 * exp(-z / H_EARTH), where P0 = 10000 and H_EARTH = 7000.0.
- `Atmos.to_pressure_coordinates` now uses reasonable pressure values when `target_pressure`
is not specified. In particular, the vertical dimension is mapped to pressure levels by
z -> P0 * exp(-z / H_EARTH), where P0 = 10000 and H_EARTH = 7000.0, following a simple
hydrostatic model for the atmosphere.

@ph-kev ph-kev force-pushed the kp/update-pres-coords branch from d62f185 to 7e715d9 Compare November 9, 2024 01:20
@ph-kev ph-kev requested a review from Sbozzolo November 11, 2024 20:15
NEWS.md Outdated
@@ -28,6 +28,10 @@ julia> ClimaAnalysis.global_rmse_pfull(sim_var, obs_var, sim_pressure = pressure

## Bug fixes
- `Atmos.to_pressure_coordinates` now works with Unitful units.
- `Atmos.to_pressure_coordinates` now uses reasonable pressure values when `target_pressure`
is not specified. In particular, the vertical dimension is mapped to pressure levels by z
-> P0 * exp(-z / H_EARTH), where P0 = 10000 and H_EARTH = 7000.0 , following a simple
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
-> P0 * exp(-z / H_EARTH), where P0 = 10000 and H_EARTH = 7000.0 , following a simple
-> P0 * exp(-z / H_EARTH), where P0 = 10000 and H_EARTH = 7000.0, following a simple

To convert from z to pressure, we use p(z) = P0 * exp(-z / H_EARTH),
where P0 = 10000 and H_EARTH = 7000.0.
@ph-kev ph-kev force-pushed the kp/update-pres-coords branch from 7e715d9 to 27f4413 Compare November 12, 2024 01:06
@ph-kev ph-kev merged commit 6576149 into CliMA:main Nov 12, 2024
9 checks passed
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.

Better interpolation for to_pressure_coordinates
2 participants