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

Support relative difference plot in zonal mean 2d set #651

Merged
merged 7 commits into from
Feb 22, 2023

Conversation

chengzhuzhang
Copy link
Contributor

Close #636
Supersede PR #637

@@ -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
Copy link
Contributor Author

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?

Copy link

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

Copy link
Contributor Author

@chengzhuzhang chengzhuzhang left a 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!

@tangq
Copy link

tangq commented Feb 17, 2023

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.

@@ -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
Copy link
Contributor Author

@chengzhuzhang chengzhuzhang Feb 17, 2023

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.

Copy link

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?

@chengzhuzhang
Copy link
Contributor Author

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.

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.

@chengzhuzhang
Copy link
Contributor Author

@tangq this PR should be ready for merge with your approval.

@tangq
Copy link

tangq commented Feb 22, 2023

Thanks, @chengzhuzhang . The PR can be merged after the minor changes suggested above are resolved.

@chengzhuzhang
Copy link
Contributor Author

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.

@tangq
Copy link

tangq commented Feb 22, 2023

@chengzhuzhang , these two minor ones seem still pending.

  • var = var / (1.0 + var) * 1000.0. Why not var = var * 1000.0?
  • revise the comment to "convert to mass mixing ratio". The unit "mol/mol" is volume mixing ratio.

@chengzhuzhang
Copy link
Contributor Author

@chengzhuzhang , these two minor ones seem still pending.

* var = var / (1.0 + var) * 1000.0. Why not var = var * 1000.0?

* revise the comment to "convert to mass mixing ratio". The unit "mol/mol" is volume mixing ratio.

Got it! I think your last round of comment went missing. I will add "mass" to differentiate from volume mixing ratio. The formula var = var / (1.0 + var) *1000 is to convert to specific humidity to match Q. But I think the difference can be ignored since the variable is very small.

Copy link

@tangq tangq left a 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

@@ -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
Copy link

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?

@@ -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
Copy link

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
Copy link
Contributor Author

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

@chengzhuzhang chengzhuzhang merged commit 25132e0 into main Feb 22, 2023
@chengzhuzhang chengzhuzhang deleted the refine_strat_Q_try2 branch February 22, 2023 22:47
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.

suggestions on improving pressure-lat zonal mean specific humidity plots
2 participants