-
Notifications
You must be signed in to change notification settings - Fork 146
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 support for NSSL 2-moment cloud microphysics scheme #761
Conversation
…n, cloud ice, snow, graupel, and hail. Graupel and hail have predicted bulk density via the particle volume. Hail can be deactived. Simple CCN concentration can be predicted, either as the count of unactivated or activated nuclei. (Mansell et al. 2010, JAS)
- Split NSSL conditional in GFS_rrtmg_pre.F90 from Thompson for now - Text comments in radiation_clouds.f
…g calcnfromq from running, which creates number concentration from the initial condition hydrometeor mass
…rious points of very small mass with large reflectivity were showing up, perhaps because of the very large time step in UFS (40s). This helps eliminate those.
…t cleaner. Changes to calcnfromq to set droplet number as 9 micron radius droplets, and then deplete CCN if turned on. Also set masses to zero if less than qxmin.
…er mixing ratios masses are transferred to water vapor. Also added second estimate for graupel number conc. and take minimum. Added air density limit in setvtz and nssl_2mom_gs to limit fall speed or rhovt. Added limit on Bigg freezing to only act if freezing radius is 8mm or less.
…d flag for nssl_ccn_on - Updataed microphysics - Radiation (rrtmg) includes calculated rain radius. Test code to compute radii in the subroutine, but something not right with incoming number concentrations - Renamed mp_nsslg to mp_nssl
FYI @tsupinie |
Companion SCM pull request is NCAR/ccpp-scm#277 |
@MicroTed, thanks for your contribution. We'll start to review it now. Thanks also for the SCM PR. Is there an associated PR for fv3atm? Also, since this PR touches many other schemes, we may need to add those schemes' respective code owners as reviewers to OK your changes too. |
Minor changes to prepare for merge
@climbfuji Since you requested changes on this PR, you will need to review again. |
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 found a few places where the code could be optimized for better computational performance, and there may be more (I did not look through the actual NSSL mp code). It will work as-is, but in the few places I highlighted these changes are easy to make.
dqdt(i,k,ntgv) = dvdftra(i,k,14) | ||
dqdt(i,k,nthv) = dvdftra(i,k,15) | ||
dqdt(i,k,ntoz) = dvdftra(i,k,16) | ||
IF ( nssl_ccn_on ) THEN |
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 would move this if loop outside these nested do loops - have another if block and then inside the if block you loop over k and i.
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.
That’s a good point, but don’t modern compilers usually take care of this as part of optimization? Basically the compiler should make two full loops, one with ccn and the other without, so that only one loop runs. A separate loop for one variable might go slightly slower?
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.
Possible. And yes, you are right, the compiler does all sorts of things. It might even do the same with my suggested approach of having two loops. Please ignore my comments regarding those optimizations.
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 had implemented this for GFS_PBL_generic.F90. Should I not commit this now?
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.
Sorry. Ted made a good point that I wasn't thinking of.
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.
Yeah, back in the day one had to consider such things! I have probably gotten dumber as compilers have gotten smarter...
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.
So, @climbfuji, does this mean that you approve of the code as-is?
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.
Yes, I will. Need to check the apparently old block of code ...
@MicroTed I'll make the changes that @climbfuji requested, retest on Hera/intel, and submit a PR into your branch. |
Minor update in microphysics to lower the supersat. threshold at which it allows droplet nucleation at low temperature (T < -36C). This alleviates rare high supersaturation in very deep strong (supercell) updrafts.
Some internal documentation has been added (comments for subroutines, etc. for doxygen). Plus added file in docs/pdftxt for the NSSL scheme. Thanks to Man Zhang for help! |
@MicroTed This PR is the next one in the queue. Please pull down the latest main, merge it into this branch, and push back to GitHub. If there are merge conflicts (which it appears there may be since this PR and main have both modified a couple of files), it looks like you just need to accept the union of the two changes, and make sure that there is no duplication. |
@grantfirl It is updated and a test run of FV3 was successful. |
@MicroTed We need to update this pull request with #869 in order to fix a compilation memory error on wcoss_dell that is largely unrelated to anything having to do with NSSL MP. Here are the steps that I would suggest:
Once this is done, you'll need to update your FV3 PR branch as well:
Once that is done, I'll update the ufs-weather-model PR branch. |
@grantfirl OK, ccpp/physics and fv3atm have been pushed. |
NSSL 2-moment Cloud Microphysics (National Severe Storms Laboratory)
Features consistent with WRF-ARW release (same code base):
Main reference: Mansell, E. R., C. L. Ziegler, and E. C. Bruning, 2010: Simulated electrification of a small thunderstorm with two-moment bulk microphysics. J. Atmos. Sci., 67, 171-194, doi:10.1175/2009JAS2965.1
Namelist options:
nssl_cccn - CCCN background CCN concentration. Default: 0.6e9 (per m^3 at STP)
nssl_alphah - graupel shape parameter, default = 0.
nssl_alphahl - hail shape parameter, default = 1.
nssl_hail_on - hail activation flag, default = .false.
nssl_ccn_on - CCN prediction flag, default = .true.
nssl_invertccn - store CCN as number of activated instead of number remaining, default = .true. (avoids need for specified boundary conditions)
Tested with SCM (pull request initiated) and earlier version tested with UFS-LAM
e.g.,
./run_scm.py -c twpice -n input_GSD_v1nssl_nohailnoccn.nml -t tracers_gsd_nssl_nohail_noccn.txt -s SCM_GSD_v1nssl
Related PRs:
For SCM: NCAR/ccpp-scm#277
For FV3: NOAA-EMC/fv3atm#472