-
Notifications
You must be signed in to change notification settings - Fork 32
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
Support relative difference plot in zonal mean 2d set #651
Conversation
e3sm_diags/derivations/acme.py
Outdated
@@ -133,6 +133,14 @@ def qflxconvert_units(var): | |||
return var | |||
|
|||
|
|||
def w_convert_q(var): | |||
if var.units == "mol/mol": | |||
var = var / (1.0 + var) * 1000.0 # convert to g/kg |
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.
@tangq would you check if the unit conversion is correct?
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.
@chengzhuzhang , you will need the molecular weights of H2O (18 g/mol) and dry air (28.97 g/mol) to convert mol/mol to g/kg.
I notice that some typos (k/kg) of the units on figures like: https://web.lcrc.anl.gov/public/e3sm/diagnostic_output/zhang40/relative_diff_try2/viewer/zonal_mean_2d/merra2/h2olnz-global-merra2/ann.html
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.
@tangq, I'm a little behind on this PR. But I think it is now ready for review. Would you please check if the additional variables added look okay: https://web.lcrc.anl.gov/public/e3sm/diagnostic_output/zhang40/relative_diff_try2/viewer/zonal_mean_2d/index.html? I'm not exactly sure if we should include obs for H2OLNZ, and if the units conversion I had makes sense. Please comment. Thank you!
I think we should include obs on the H2OLNZ plot to have some reference. Are we going to have the relative difference plots too? Thanks adding these figures. |
e3sm_diags/derivations/acme.py
Outdated
@@ -133,6 +133,15 @@ def qflxconvert_units(var): | |||
return var | |||
|
|||
|
|||
def w_convert_q(var): | |||
if var.units == "mol/mol": | |||
var = var * 18.0 / 28.97 # convert to mixing ratio |
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.
@tangq It's an embarrassing miss...I correct the formula. Now values of Q and H2OLNO are very close, not identical though.
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.
On the line below, it is var = var / (1.0 + var) * 1000.0
. Why not var = var * 1000.0
?
Thank you for reviewing and catching the error. It is now fixed, hopefully. Please check again: https://web.lcrc.anl.gov/public/e3sm/diagnostic_output/zhang40/relative_diff_try3/viewer/zonal_mean_2d/index.html. If things look okay, I will add the relative difference plots of both variables into default variables list. |
@tangq this PR should be ready for merge with your approval. |
Thanks, @chengzhuzhang . The PR can be merged after the minor changes suggested above are resolved. |
@tangq yes it has been resolved: https://web.lcrc.anl.gov/public/e3sm/diagnostic_output/zhang40/relative_diff_try3/viewer/zonal_mean_2d/index.html And I added H2OLNZ to default variable list with both relative and absolute difference plot. |
@chengzhuzhang , these two minor ones seem still pending.
|
Got it! I think your last round of comment went missing. I will add "mass" to differentiate from volume mixing ratio. The formula |
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.
Thank you for working on this, @chengzhuzhang
e3sm_diags/derivations/acme.py
Outdated
@@ -133,6 +133,15 @@ def qflxconvert_units(var): | |||
return var | |||
|
|||
|
|||
def w_convert_q(var): | |||
if var.units == "mol/mol": | |||
var = var * 18.0 / 28.97 # convert to mixing ratio |
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.
On the line below, it is var = var / (1.0 + var) * 1000.0
. Why not var = var * 1000.0
?
e3sm_diags/derivations/acme.py
Outdated
@@ -133,6 +133,15 @@ def qflxconvert_units(var): | |||
return var | |||
|
|||
|
|||
def w_convert_q(var): | |||
if var.units == "mol/mol": | |||
var = var * 18.0 / 28.97 # convert to mixing ratio |
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'd suggest to revise the comment to "convert to mass mixing ratio". The unit "mol/mol" is volume mixing ratio.
def w_convert_q(var): | ||
if var.units == "mol/mol": | ||
var = ( | ||
var * 18.0 / 28.97 * 1000.0 |
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 updated the formula and comments. Thank you for the suggestion and review, @tangq
Close #636
Supersede PR #637