-
Notifications
You must be signed in to change notification settings - Fork 164
Fix mpas_atm compute_full_pressure #429
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
Conversation
Thanks for this Soyoung. For the change in constants cv and cp does this apply to mpas versions 5.0 onwards? |
It looks like MPAS Versions 5 through 7 have these new parameters. |
great thanks! |
waiting for science review on this. |
! redefined here for consistency with the model (MPAS/src/framework/mpas_constants.F). | ||
real(r8), parameter :: rgas = 287.0_r8 ! = R_d (Gas constant for dry air [J kg-1 K-1]) | ||
real(r8), parameter :: rv = 461.6_r8 ! = R_v (Gas constant for water varpor [J kg-1 K-1]) | ||
real(r8), parameter :: cp = 7.*rgas/2. ! = 1004.5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another comment might be helpful here: "For an ideal diatomic gas, cp:cv:R is 7:5:2"
|
||
where (istatus == 0) ! We only take non-missing tk here | ||
pressure = rho * rgas * tk * (1.0_r8 + 1.61_r8 * qv_nonzero) | ||
! Soyoung (Nov-2022): The last term is added for full pressure P = (rho_d*R_d + rho_v*R_v)*tk |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see yet where the qv**2 term comes from.
From the ideal gas law, as written in the comment here,
P = rho_d*R_d*tk * [1 + (rho_v/rho_d)(R_v/R_d)]
Translating into the variables and parameters defined in this module:
P = rho *rgas*tk * [1 + qv_nonzero * rvord]
which is the unmodified code. It would be helpful to confirm that
MPAS uses mixing ratio (mass_v/mass_d),
not specific humidity (mass_v/mass_(v+d))?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have one suggestion and one major sticking point.
just a note to say that i talked with soyoung about this today. she's sure the equation is correct; mpas uses mixing ratio and it is just the comment about the equation that needs to be clarified. at some point soon she is going to merge in the current main branch and update the code for this pull request. |
@nancycollins and @syha
|
@kdraeder, thanks for your examination with patience! |
in the interest of putting this issue to bed - soyoung says that she was looking at how jedi handles computing pressure for mpas. they do a transform which requires a different equation (which includes the squared term). she says the original equation and comment are correct for the dart model_mod, and that is why this pull request is closed. the original code and comment should remain unchanged. the constants need to be updated and that's happening in a separate pull request (#521). |
Description:
The HofX (e.g., observation operators) described in model_mod.f90 computes the pressure field based on the equation of state to find the vertical locations of observations at pressure levels (ex. radiosondes). Because the "rho" used in model_mod indicates dry air density (e.g., rho_d), not air density (= rho_d + rho_v), we need to add the second order term for water vapor mixing ratio (qv) to compute the full pressure accounting for the moisture effect correctly.
Also, a few parameters are updated based on MPAS/src/framework/mpas_constants.F.
Fixes issue
=> pressure = rho * rgas * tk * (1.0_r8 + rvord * qv_nonzero + rvordm1 * qv_nonzero**2)
fixes #251
Types of changes
Documentation changes needed?
Tests
Not tested with data yet, but compiled successfully (on cheyenne).
Checklist for merging
Checklist for release