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

MP38 Thompson 2-mom graupel/hail (prev #1667) #1728

Closed
wants to merge 11 commits into from

Conversation

mefrediani
Copy link
Contributor

Option to compute two-moment prognostics for graupel/hail

TYPE: enhancement, new feature

KEYWORDS: microphysics, Thompson microphysics, graupel, hail, double-moment

SOURCE: Code developed by Greg Thompson (JCSDA, UCAR) and Anders Jensen (RAL, NCAR).
Implemented in WRF v4.4 by Maria Frediani (RAL, NCAR)

DESCRIPTION OF CHANGES:

This code update includes

a package to compute two-moment prognostics for graupel/hail and a predicted density graupel category (mp_physics=38);
an update to the Y-intercept relationship for one-moment graupel; and
it replaces air temperature for wet-bulb temperature in riming and mixed phase processes.
Problem:

One-dimensional graupel/hail growth does not couple to the storm dynamics and is insufficient for predicting more detailed microphysical storm characteristics and hazards such as hail size, density, and fall speed, which can be used to provide guidance on the timing and spatial extent of damaging hail.

Sensitivity studies have shown that using a constant intercept parameter and a constant density can significantly constrain predicted hail size: simulated storms either produced only pea-size or baseball-size hail (Gilmore et al. 2004).

Improving the representation of riming and mixed phase processes leads to improvements in predicted storm dynamics and propagation speed through microphysical feedbacks and also improves the spatial distribution and type of precipitation at the surface.

Solution:

Changes related with the new package mp_physics=38 include:

Variable density for graupel (rho_g)
Parameters become a function of rho_g (am_g, av_g, bv_g, cge, cgg, oamg)
Extra dimension in lookup tables to account for graupel variable density (rho_g)
New source/sink terms for 3-moment graupel
Computation of radar reflectivity and nwp diagnostics using graupel volume mixing ratio
Additional modifications affecting mp_physics=8 and mp_physics=28 include:

Fall speed power law relations (av_i from 1847.5 to 1493.9)
Reduced dimension of cse, csg (from 18 to 17)
Use of wet-bulb temperature for riming and mixed-phase process
Modified relationship for the Y-intercept of one-moment graupel to shift the properties of the graupel category to become more hail-like, resulting in a category that represents both graupel and hail.
ISSUE: NA

LIST OF MODIFIED FILES:
M Registry/Registry.EM_COMMON
M phys/module_diag_nwp.F
M phys/module_diagnostics_driver.F
M phys/module_microphysics_driver.F
M phys/module_mp_thompson.F
M phys/module_physics_init.F

TESTS CONDUCTED:
The modifications were initially demonstrated using the original development made for WRF v4.0 (Jensen et al 2021, under review, MWR-D-21-0319). The operational mp28, mp28 with modified graupel Y-intercept, and mp38 were evaluated for a case study during the PECAN campaign using observed hail sizes from storm reports and estimated from radar. The evaluation showed clear improvement of the simulated reflectivity values in the upper-levels of discrete storms, coinciding with a significant reduction in the areal extent of graupel aloft, also seen when using the updated one-moment scheme. The two-moment and predicted density graupel scheme was also better able to predict a wide variety of hail sizes at the surface, including large (>2-inch in diameter) hail that was observed during this case.

The implementation for this develop branch (aiming at the release v4.4) was tested using a case study from the Relampago campaign and results from mp28, mp38-v4.0, mp38-develop-v4.4 were compared. This comparison indicates that the implementation was successful.

RELEASE NOTE: Include a stand-alone message suitable for the inclusion in the minor and annual releases. A publication citation is appropriate.

@mefrediani mefrediani requested review from a team as code owners April 28, 2022 23:02
@weiwangncar
Copy link
Collaborator

Congratulations, Maria! The Jenkins tests have passed:

Test Type              | Expected  | Received |  Failed
= = = = = = = = = = = = = = = = = = = = = = = =  = = = =
Number of Tests        : 23           24
Number of Builds       : 60           58
Number of Simulations  : 158           156        0
Number of Comparisons  : 95           92        0

Failed Simulations are: 
None
Which comparisons are not bit-for-bit: 
None

@dudhia
Copy link
Collaborator

dudhia commented Apr 29, 2022 via email

@mefrediani
Copy link
Contributor Author

@gthompsnWRF Could you please review the proposed modification I made to the graupel table (5c47003..82edd98)? The jenkins test passed.

Basically, when is_hail_aware is false, the loop do n3=1, NRHG becomes do n3=1, 1 and the coefficient indices (av_g, bv_g, am_g) are set to idx_bg1 instead of n3. Once the computation is done, it copies the values to the remaining indices, from 2 to NRHG. This means that the table variables will have the same values across the rho_g dimension , representing rho_g(idx_bg1).

I noticed that you hard-coded the 2nd dimension of cgg, and cge to 1 instead of n3 (throughout the code, not only in qr_acr_qg). I'm not sure if that's the intention or not.

The other potential solution (i.e. separate the tables for mp28,8 and mp38) is quite a rabbit hole. I'd have to test is_hail_aware throughout the code because there are multiple max/min statements using NRHG or rho_g(NRHG), and I think it would become a mess very hard to untangle and prone to bugs.

image

@mefrediani
Copy link
Contributor Author

@dudhia I reduced the graupel table computation to 1 dimension when mp=8 or 28. Then I copied the computed values to the remaining 8 elements that would represent the graupel variable-density in mp38. There's a more detailed explanation in my previous post to Greg. Please let me know if you have any questions.

@dudhia
Copy link
Collaborator

dudhia commented Apr 29, 2022 via email

@mefrediani
Copy link
Contributor Author

Good point @dudhia. I'll create distinct table names then. This is simple.

@gthompsnWRF
Copy link
Contributor

Good point @dudhia. I'll create distinct table names then. This is simple.

This sounds like the best idea. A distinct table name for qr_acr_qg for each of the options is better by far. Thanks for doing this Maria!!

@mefrediani
Copy link
Contributor Author

@weiwangncar @dudhia I changed the table names to either qr_acr_qg_mp38V1.dat or qr_acr_qg_mp28V4.dat and tested it for mp38, mp28 and mp8. It's working as expected. Please let me know if anything else is needed for merging it with the develop branch. Thanks!

@weiwangncar
Copy link
Collaborator

Jenkins tests have passed for the last change:

Test Type              | Expected  | Received |  Failed
= = = = = = = = = = = = = = = = = = = = = = = =  = = = =
Number of Tests        : 23           24
Number of Builds       : 60           58
Number of Simulations  : 158           156        0
Number of Comparisons  : 95           92        0

Failed Simulations are: 
None
Which comparisons are not bit-for-bit: 
None

@weiwangncar
Copy link
Collaborator

@mefrediani @gthompsnWRF Thanks for making these changes to allow regression tests to pass. Do you have any suggestions how we will go about creating the table for double moment graupel/hail? It still takes a very long time when people first choose the option.

@mefrediani
Copy link
Contributor Author

@weiwangncar Could we add another item and a link to download it on this page: https://www2.mmm.ucar.edu/wrf/users/download/get_source.html ?

@weiwangncar
Copy link
Collaborator

@mefrediani That could be a solution.

@mefrediani
Copy link
Contributor Author

@weiwangncar do you need anything else from me in order to approve the merge? Do you want to add the table on the webpage asap or later when approaching the next major release?

@weiwangncar
Copy link
Collaborator

@mefrediani I don't have concern as of now. If you have the computed tables for the new option, you can pass them to us. We probably won't need them until the next release, but we can keep them on Cheyenne. The reg tests won't test the new option, so I assume you have, with the renamed tables?
@dudhia Are you ok with this PR, and with the proposed solution to provide the tables as an alternative?

@dudhia
Copy link
Collaborator

dudhia commented May 19, 2022

@mefrediani could you update the PR message to include what was done with the table? I wonder if we also need a manual bit-for-bit test with the new option since it is not in the regtest.

ENDIF
!
CASE (THOMPSONGH)
CALL wrf_debug ( 100 , 'microphysics_driver: calling thompson' )
Copy link
Collaborator

Choose a reason for hiding this comment

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

should print thompsongh

@gthompsnWRF
Copy link
Contributor

I should have one more look at the code changes just to double-check a few things. Thanks Maria for doing this!!!

@mefrediani
Copy link
Contributor Author

I should have one more look at the code changes just to double-check a few things. Thanks Maria for doing this!!!

@gthompsnWRF were you able to do the final checks in the code?

@dudhia
Copy link
Collaborator

dudhia commented Oct 11, 2022 via email

@mefrediani mefrediani requested review from a team as code owners December 29, 2022 19:58
@mefrediani
Copy link
Contributor Author

Regarding the table, maybe that can be added to the run directory as part of the PR to get it through the regtest, but then we don't commit it. Would that work?

@dudhia This didn't work. When I push it, Git gives me an error:
remote: error: File run/qr_acr_qg_mp38V1.dat is 772.13 MB; this exceeds GitHub's file size limit of 100.00 MB

@dudhia
Copy link
Collaborator

dudhia commented Dec 29, 2022

OK, interesting that there is a limit. We'll see what the test does. Will other Thompson options also try to use that big table? Because those will be in the automatic tests.

@mefrediani
Copy link
Contributor Author

mefrediani commented Dec 29, 2022

@kkeene44 I think I broke my remote branch. I used the web interface to sync with the fork and somehow it synced with master. Do i need to create a new PR to fix this?

@mefrediani
Copy link
Contributor Author

OK, interesting that there is a limit. We'll see what the test does. Will other Thompson options also try to use that big table? Because those will be in the automatic tests.

@dudhia No, the big table (qr_acr_qg_mp38V1.dat) is only needed for MP38. There's a different table for MP28 and MP8 (qr_acr_qg_mp28V4.dat).

@weiwangncar
Copy link
Collaborator

weiwangncar commented Jan 4, 2023

@mefrediani This is for future reference: there is never a need to merge with updated branch or even the master branch for an existing PR. The git software will check for any conflict and warn and/block if we try to merge. Any conflicts found at that point will require fixes. Let's wait and retry your code after we resolve reg test issues.

@mefrediani
Copy link
Contributor Author

@weiwangncar thanks for the clarification. I'll remember that in the future. In my other PR (1801), Jimy mentioned you're having issues with the reg tests, so I'll hang on for now and wait for someone to tell me if there's anything else I can do.

Copy link
Collaborator

@dudhia dudhia left a comment

Choose a reason for hiding this comment

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

Changes are showing up not related to this scheme

chem/depend.chem Outdated
@@ -229,7 +229,7 @@ module_mosaic_sect_intr.o: module_mosaic_coag1d.o module_mosaic_coag3d.o module_

module_mosaic_aerdynam_intr.o: module_mosaic_sect_intr.o module_mosaic_aerchem_intr.o

module_mosaic_addemiss.o: module_data_mosaic_asect.o module_data_sorgam.o
module_mosaic_addemiss.o: module_data_mosaic_asect.o module_data_sorgam.o module_gocart_dust.o
Copy link
Collaborator

Choose a reason for hiding this comment

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

wondering why gocart is added here

inc/version_decl Outdated
@@ -1 +1 @@
CHARACTER (LEN=*), PARAMETER :: release_version = 'V4.4'
CHARACTER (LEN=*), PARAMETER :: release_version = 'V4.4.2'
Copy link
Collaborator

Choose a reason for hiding this comment

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

this needs updating to V4.5

run/VEGPARM.TBL Outdated
LCZ_11
41
61
Copy link
Collaborator

Choose a reason for hiding this comment

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

These changes seem to indicate some inconsistency in branches because they should already be in

@dudhia
Copy link
Collaborator

dudhia commented Jan 13, 2023

@mefrediani could you resubmit this PR to see if it resolves the issue of seeing unrelated updates in the git differences for files changed?

@mgduda
Copy link
Collaborator

mgduda commented Jan 13, 2023

@mefrediani could you resubmit this PR to see if it resolves the issue of seeing unrelated updates in the git differences for files changed?

I don't think simply re-submitting the PR with the same branch is going to be a solution. I'll take a look through the branch history today and suggest a suitable rebase of the current PR branch.

@mgduda
Copy link
Collaborator

mgduda commented Jan 13, 2023

@mefrediani I think most of the issues that @weiwangncar and @dudhia are concerned about originate from the merge of the master branch into your mp_phys38 branch in 8c6fd9f. If there wasn't a specific reason for the merge (8c6fd9f), I think it should work to interactively rebase mp_phys38 beginning with 4993d748 to remove all unnecessary commits. You can do this with git rebase -i 4993d7482^, and after a quick look, it seems that these are the only commits that you'd need to keep:

2be270a2
7c8d466a
41ba43f3
82edd98b
22488d49
5c470033
a2d53f3a
28702c98
6c16c162
11a99d68
4993d748

If you have any questions about the rebase process, just let me know and I'll be glad to help.

@mefrediani
Copy link
Contributor Author

@dudhia, @mgduda I was at AMS last week, I apologize for my late response. I'll try to get this done today before Cheyenne's planned outage.

@mefrediani
Copy link
Contributor Author

@mgduda thank you so much for your help with the rebase. I think it worked. I had to create a new PR because after rebasing, the branch was not fast-forwardable. The new PR is #1808.

@dudhia
Copy link
Collaborator

dudhia commented Jan 17, 2023 via email

@mgduda
Copy link
Collaborator

mgduda commented Jan 17, 2023

@mgduda thank you so much for your help with the rebase. I think it worked. I had to create a new PR because after rebasing, the branch was not fast-forwardable. The new PR is #1808.

What was the problem that resulted from a non-fast-forwardable branch?

@mefrediani
Copy link
Contributor Author

@mgduda When I tried to push it, I got this message:
! [rejected] mp_phys38 -> mp_phys38 (non-fast-forward)
error: failed to push some refs to 'github.com:mefrediani/WRF.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

@mgduda
Copy link
Collaborator

mgduda commented Jan 17, 2023

@mgduda When I tried to push it, I got this message: ! [rejected] mp_phys38 -> mp_phys38 (non-fast-forward) error: failed to push some refs to 'github.com:mefrediani/WRF.git' hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Integrate the remote changes (e.g. hint: 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.

For future reference, you can just use git push --force ....

@weiwangncar
Copy link
Collaborator

@mefrediani If your branch still exists, you can give Michael's suggestion a try. It won't change anything but your branch on the Github. We will later close this PR.

@mefrediani
Copy link
Contributor Author

@weiwangncar I'd like to try it but Cheyenne/Glade is offline this week. Can you wait until next to close this PR?
Thank you!

@weiwangncar
Copy link
Collaborator

@weiwangncar I'd like to try it but Cheyenne/Glade is offline this week. Can you wait until next to close this PR? Thank you!

We can certainly do that. There is no hurry to close a PR.

@mefrediani
Copy link
Contributor Author

@mgduda @weiwangncar Michael's suggestion worked! Thank you!

weiwangncar pushed a commit that referenced this pull request Jan 26, 2023
Option to compute two-moment prognostics for graupel/hail

TYPE: enhancement, new feature

KEYWORDS: microphysics, Thompson microphysics, graupel, hail, double-moment

SOURCE: Code developed by Greg Thompson (JCSDA, UCAR) and Anders Jensen (RAL, NCAR).
Implemented in WRF v4.4 by Maria Frediani (RAL, NCAR)

DESCRIPTION OF CHANGES:

This code update includes

a package to compute two-moment prognostics for graupel/hail and a predicted density graupel category (mp_physics=38); an update to the Y-intercept relationship for one-moment graupel; and it replaces air temperature for wet-bulb temperature in riming and mixed phase processes.

Problem:

One-dimensional graupel/hail growth does not couple to the storm dynamics and is insufficient for predicting more detailed microphysical storm characteristics and hazards such as hail size, density, and fall speed, which can be used to provide guidance on the timing and spatial extent of damaging hail.

Sensitivity studies have shown that using a constant intercept parameter and a constant density can significantly constrain predicted hail size: simulated storms either produced only pea-size or baseball-size hail (Gilmore et al. 2004).

Improving the representation of riming and mixed phase processes leads to improvements in predicted storm dynamics and propagation speed through microphysical feedbacks and also improves the spatial distribution and type of precipitation at the surface.

Solution:

Changes related with the new package mp_physics=38 include:

Variable density for graupel (rho_g)
Parameters become a function of rho_g (am_g, av_g, bv_g, cge, cgg, oamg)
Extra dimension in lookup tables to account for graupel variable density (rho_g)
New source/sink terms for 3-moment graupel
Computation of radar reflectivity and nwp diagnostics using graupel volume mixing ratio
Additional modifications affecting mp_physics=8 and mp_physics=28 include:

Fall speed power law relations (av_i from 1847.5 to 1493.9)
Reduced dimension of cse, csg (from 18 to 17)
Use of wet-bulb temperature for riming and mixed-phase process
Modified relationship for the Y-intercept of one-moment graupel to shift the properties of the graupel category to become more hail-like, resulting in a category that represents both graupel and hail.

LIST OF MODIFIED FILES:
M Registry/Registry.EM_COMMON
M phys/module_diag_nwp.F
M phys/module_diagnostics_driver.F
M phys/module_microphysics_driver.F
M phys/module_mp_thompson.F
M phys/module_physics_init.F

TESTS CONDUCTED:
1. The modifications were initially demonstrated using the original development made for WRF v4.0 (Jensen et al 2021, under review, MWR-D-21-0319). The operational mp28, mp28 with modified graupel Y-intercept, and mp38 were evaluated for a case study during the PECAN campaign using observed hail sizes from storm reports and estimated from radar. The evaluation showed clear improvement of the simulated reflectivity values in the upper-levels of discrete storms, coinciding with a significant reduction in the areal extent of graupel aloft, also seen when using the updated one-moment scheme. The two-moment and predicted density graupel scheme was also better able to predict a wide variety of hail sizes at the surface, including large (>2-inch in diameter) hail that was observed during this case.

The implementation for this develop branch (aiming at the release v4.4) was tested using a case study from the Relampago campaign and results from mp28, mp38-v4.0, mp38-develop-v4.4 were compared. This comparison indicates that the implementation was successful.

2. It passed regression tests.

RELEASE NOTES: A package to compute two-moment prognostics for graupel/hail and a predicted density graupel category is added in the Thompson scheme (mp_physics=38); Other updates to the scheme include a change to the Y-intercept relationship for one-moment graupel; and replacement of air temperature for wet-bulb temperature in riming and mixed phase processes.

The code requires a data file to run. This data file: qr_acr_qg_mp38V1.dat can be found on NCAR's computer under /glade/work/wrfhelp/WRF_files/, and online at http://www2.mmm.ucar.edu/wrf/src/wrf_files/. If you prefer to compute this file, set namelist write_thompson_mp38table = true. Note that it can take up to 18 min to compute this table using a 12-CPU job, 4 min on 128-CPU, and several hours if computed on a single CPU.
@dudhia
Copy link
Collaborator

dudhia commented Jan 26, 2023

Superseded by #1808

@dudhia dudhia closed this Jan 26, 2023
vlakshmanan-scala pushed a commit to scala-computing/WRF that referenced this pull request Apr 4, 2024
wrf-model#1808)

Option to compute two-moment prognostics for graupel/hail

TYPE: enhancement, new feature

KEYWORDS: microphysics, Thompson microphysics, graupel, hail, double-moment

SOURCE: Code developed by Greg Thompson (JCSDA, UCAR) and Anders Jensen (RAL, NCAR).
Implemented in WRF v4.4 by Maria Frediani (RAL, NCAR)

DESCRIPTION OF CHANGES:

This code update includes

a package to compute two-moment prognostics for graupel/hail and a predicted density graupel category (mp_physics=38); an update to the Y-intercept relationship for one-moment graupel; and it replaces air temperature for wet-bulb temperature in riming and mixed phase processes.

Problem:

One-dimensional graupel/hail growth does not couple to the storm dynamics and is insufficient for predicting more detailed microphysical storm characteristics and hazards such as hail size, density, and fall speed, which can be used to provide guidance on the timing and spatial extent of damaging hail.

Sensitivity studies have shown that using a constant intercept parameter and a constant density can significantly constrain predicted hail size: simulated storms either produced only pea-size or baseball-size hail (Gilmore et al. 2004).

Improving the representation of riming and mixed phase processes leads to improvements in predicted storm dynamics and propagation speed through microphysical feedbacks and also improves the spatial distribution and type of precipitation at the surface.

Solution:

Changes related with the new package mp_physics=38 include:

Variable density for graupel (rho_g)
Parameters become a function of rho_g (am_g, av_g, bv_g, cge, cgg, oamg)
Extra dimension in lookup tables to account for graupel variable density (rho_g)
New source/sink terms for 3-moment graupel
Computation of radar reflectivity and nwp diagnostics using graupel volume mixing ratio
Additional modifications affecting mp_physics=8 and mp_physics=28 include:

Fall speed power law relations (av_i from 1847.5 to 1493.9)
Reduced dimension of cse, csg (from 18 to 17)
Use of wet-bulb temperature for riming and mixed-phase process
Modified relationship for the Y-intercept of one-moment graupel to shift the properties of the graupel category to become more hail-like, resulting in a category that represents both graupel and hail.

LIST OF MODIFIED FILES:
M Registry/Registry.EM_COMMON
M phys/module_diag_nwp.F
M phys/module_diagnostics_driver.F
M phys/module_microphysics_driver.F
M phys/module_mp_thompson.F
M phys/module_physics_init.F

TESTS CONDUCTED:
1. The modifications were initially demonstrated using the original development made for WRF v4.0 (Jensen et al 2021, under review, MWR-D-21-0319). The operational mp28, mp28 with modified graupel Y-intercept, and mp38 were evaluated for a case study during the PECAN campaign using observed hail sizes from storm reports and estimated from radar. The evaluation showed clear improvement of the simulated reflectivity values in the upper-levels of discrete storms, coinciding with a significant reduction in the areal extent of graupel aloft, also seen when using the updated one-moment scheme. The two-moment and predicted density graupel scheme was also better able to predict a wide variety of hail sizes at the surface, including large (>2-inch in diameter) hail that was observed during this case.

The implementation for this develop branch (aiming at the release v4.4) was tested using a case study from the Relampago campaign and results from mp28, mp38-v4.0, mp38-develop-v4.4 were compared. This comparison indicates that the implementation was successful.

2. It passed regression tests.

RELEASE NOTES: A package to compute two-moment prognostics for graupel/hail and a predicted density graupel category is added in the Thompson scheme (mp_physics=38); Other updates to the scheme include a change to the Y-intercept relationship for one-moment graupel; and replacement of air temperature for wet-bulb temperature in riming and mixed phase processes.

The code requires a data file to run. This data file: qr_acr_qg_mp38V1.dat can be found on NCAR's computer under /glade/work/wrfhelp/WRF_files/, and online at http://www2.mmm.ucar.edu/wrf/src/wrf_files/. If you prefer to compute this file, set namelist write_thompson_mp38table = true. Note that it can take up to 18 min to compute this table using a 12-CPU job, 4 min on 128-CPU, and several hours if computed on a single CPU.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants