NCAR / ccpp-physics

GFS physics for CCPP
Other
58 stars 145 forks source link

Incorrect Thompson MP tracer count in GFS PBL generic pre/post run methods #880

Closed rmontuoro closed 2 years ago

rmontuoro commented 2 years ago

Description

The total number of tracers in Thompson microphysics is incorrectly returned by set_aerosol_tracer_index(): https://github.com/NCAR/ccpp-physics/blob/979324a89894133473c4663fc490d04cdce57ac0/physics/GFS_PBL_generic.F90#L37-L43 which is used in GFS_PBL_generic_pre_run() and GFS_PBL_generic_post_run() if PBL mixing is enabled for atmospheric tracers (trans_aero = (trans_trac .and. cplchm) = .true.).

The proper number may be found in noaa-emc/fv3atm/ccpp/data/GFS_typedef.F90:

    if (Model%imp_physics == Model%imp_physics_thompson) then
      if (Model%ltaerosol) then
        Interstitial%nvdiff = 12
      else
        Interstitial%nvdiff = 9
      endif

This bug affects prototype 8b as it features both Thompson MP and prognostic aerosols.

ligiabernardet commented 2 years ago

Does it affects uncoupled suites that is ice- and water-friendly aerosols, such as RRFS v1?

rmontuoro commented 2 years ago

set_aerosol_tracer_index() is only called when trans_trac=.true. and cplchm=.true. (i.e., trans_aero=.true.): https://github.com/NCAR/ccpp-physics/blob/979324a89894133473c4663fc490d04cdce57ac0/physics/GFS_PBL_generic.F90#L321-L339

I don't expect this bug to have an impact on coupled/uncoupled configurations that do not include UFS-Aerosols.

I would suggest refactoring microphysics-related code that includes assumptions on the number and location of microphysics tracers throughout CCPP physics suites.

lisa-bengtsson commented 2 years ago

Would it be possible to add attributes to the tracers in the field_table to easier keep track whether a tracer should be vertically diffused in physics, advected in the dycore, etc?

climbfuji commented 2 years ago

Would it be possible to add attributes to the tracers in the field_table to easier keep track whether a tracer should be vertically diffused in physics, advected in the dycore, etc?

There is a new capability in capgen.py (the supposed-to-be successor of the current code generator ccpp_prebuild.py that contains constituent information, including whether something is supposed to be vertically diffused, horizontally advected, ... - making a similar change in ccpp_prebuild.py only makes sense if the transition to capgen.py is delayed significantly or won't happen (I don't know the answer to these questions).

lisa-bengtsson commented 2 years ago

Thanks Dom, I think such an approach would be very valuable, then these hard coded values could be replaced by values generated directly after reading the field table.

gthompsnWRF commented 2 years ago

Here are my 2 cents on the topic based on WRF experience. I believe that any bulk microphysics scheme's rain and graupel species should not be vertically diffused with PBL mixing coefficients as they should fall too fast to be affected by "diffusion" whereas the variables of: cloud ice (mass and number?), cloud water (mass and number?), and aerosol variables should certainly have consistent mixing that is done for water vapor. It might be fair to say that snow is questionable since it has a fallspeed near 1 m/s, maybe it isn't necessary similar to rain/graupel.