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

Add support for NSSL 2-moment cloud microphysics scheme #761

Merged
merged 77 commits into from
Mar 4, 2022

Conversation

MicroTed
Copy link
Contributor

@MicroTed MicroTed commented Oct 15, 2021

NSSL 2-moment Cloud Microphysics (National Severe Storms Laboratory)

Features consistent with WRF-ARW release (same code base):

  • Fully 2-moment (mass and number), for droplets, rain, ice crystal, snow, graupel, and hail (hail can be deactivated)
  • Predicted bulk concentration of cloud condensation nuclei (CCN) (optional)
  • Allows residual supersaturation (no saturation adjustment) for reasonably physical aerosol response
  • Adaptive 2-moment sedimentation to prevent excessive size sorting
  • Predicts bulk density of graupel and hail
  • Hail species intended as “true” hail, characterized by size and source rather than simple density
  • Designed primarily for convection-allowing grid spacing (dx <= ~4km)
  • Computes effective radii for radiation (sets effr_in=.true.)
  • Computes radar reflectivity assuming Rayleigh scattering (sets ltradar=.true.)

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

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

FYI @tsupinie

@MicroTed
Copy link
Contributor Author

Companion SCM pull request is NCAR/ccpp-scm#277

@grantfirl
Copy link
Collaborator

@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.

@grantfirl
Copy link
Collaborator

@climbfuji Since you requested changes on this PR, you will need to review again.

@grantfirl
Copy link
Collaborator

@MicroTed This will need to be updated to main until it is your turn in the UFS merge queue. I'm going to ask that it be next behind #820

Copy link
Collaborator

@climbfuji climbfuji left a 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
Copy link
Collaborator

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.

Copy link
Contributor Author

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?

Copy link
Collaborator

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.

Copy link
Collaborator

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?

Copy link
Collaborator

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.

Copy link
Contributor Author

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...

Copy link
Collaborator

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?

Copy link
Collaborator

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 ...

physics/GFS_PBL_generic.F90 Show resolved Hide resolved
physics/GFS_PBL_generic.F90 Show resolved Hide resolved
physics/GFS_PBL_generic.F90 Show resolved Hide resolved
physics/GFS_rrtmg_pre.F90 Outdated Show resolved Hide resolved
physics/GFS_suite_interstitial.F90 Show resolved Hide resolved
physics/module_MYNNPBL_wrapper.F90 Show resolved Hide resolved
@grantfirl
Copy link
Collaborator

@MicroTed I'll make the changes that @climbfuji requested, retest on Hera/intel, and submit a PR into your branch.

@climbfuji climbfuji requested review from climbfuji and removed request for llpcarson February 17, 2022 20:03
 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.
@MicroTed
Copy link
Contributor Author

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!

@grantfirl
Copy link
Collaborator

@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.

@MicroTed
Copy link
Contributor Author

@grantfirl It is updated and a test run of FV3 was successful.

@grantfirl
Copy link
Collaborator

@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:

  1. Starting from within ccpp/physics on your local machine, let's add Dom Heinzeller's fork as a remote (since that is where Add logic to reduce optimization for host-model provided GFS_typedefs.F90 #869 is coming from): git remote add dom-fork https://github.com/climbfuji/ccpp-physics
  2. Fetch Dom's branches: git fetch dom-fork
  3. Checkout Add logic to reduce optimization for host-model provided GFS_typedefs.F90 #869 PR branch: git checkout feature/reduce_opt_gfs_typedefs
  4. Merge this into your feature/nsslmicro branch: git checkout feature/nsslmicro, git merge feature/reduce_opt_gfs_typedefs
  5. Push to Github

Once this is done, you'll need to update your FV3 PR branch as well:

  1. cd up to FV3
  2. git add ccpp/physics, git commit -m "update ccpp/physics submodule pointer"
  3. Push to GitHub

Once that is done, I'll update the ufs-weather-model PR branch.

@MicroTed
Copy link
Contributor Author

MicroTed commented Mar 3, 2022

@grantfirl OK, ccpp/physics and fv3atm have been pushed.

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.

3 participants