Repository navigation
Add the P3 cloud microphysics scheme (config_microp_scheme = 'mp_p3') - #1536
hmorrison100 wants to merge 3 commits into
Conversation
bl_mynn_pre_run zeroed sqc and sqi but not sqs, which is set only when f_qs is true. With a scheme that has no snow category (P3, f_qs=.false.) MYNN read an uninitialized snow specific content, used in mym_condensation (qi+qs in the subgrid cloud fraction above the PBL). Results depended on the compiler: P3+MYNN differed between Intel and nvhpc by 4-6% in kzh and sigw_p3 after 1 h. Found with an Intel -init=snan -fpe0 build (trap at bl_mynn.F90:638). With sqs zeroed, Intel and nvhpc agree to round-off (kzh 5e-5, sigw_p3 2e-6, hpbl 4e-6). Bit-for-bit for schemes with snow (f_qs=.true., e.g. Thompson, WSM6), where sqs is always overwritten: Thompson-aerosols + MYNN + GF 1-h run identical in history and diag files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The P3 microphysics (next commit) reads four lookup tables. They are stored gzipped because the 3-moment ice table exceeds GitHub's 100 MB file limit unzipped. The table filenames carry the table version, which P3 checks when reading them. - physics/physics_wrf/p3_lookup_tables: the four P3 lookup tables, gzipped - physics/Makefile: unzip the tables into physics_wrf/files after the lookup_tables target; dependency-based, so a rebuild does not unzip again - core_atmosphere/Makefile: link the tables to the top-level directory with the other physics data files; remove the links on make clean - CMakeLists.txt: unzip the tables into the build directory at configure time (only if missing or older than the .gz) and install them with the other physics data files - setup_run_dir.py: link the P3 tables into the run directory - .gitignore: ignore the top-level table links With the tables linked into the run directory, P3 needs no namelist setting to find them. Fresh-clone make and CMake builds tested. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…p3')
Add the Predicted Particle Properties (P3) bulk microphysics scheme,
version 6.0.0-rc3+mpas+sbaut (physics_wrf/module_mp_p3.F, from the P3
repository jason-milbrandt/P3-microphysics, branch dev-aerosols-mpas).
The MPAS interface started from the Stanford group's P3 implementation
for MPAS v8.3.1 (qigeuw/P3-microphysics-MPAS) and was ported to v8.4.2
and develop, then extended and restructured.
P3 has one to three free ice categories, each with prognostic total ice
mass, number, rime mass and rime volume (p3_qit, p3_qni, p3_qir,
p3_qib), optionally the sixth moment (p3_qzi, triple-moment ice) and the
liquid fraction (p3_qli); double-moment cloud water and rain; and
optional predicted water- and ice-friendly aerosols (nwfa, nifa) with
ARG droplet activation that uses the sub-grid vertical velocity from the
PBL scheme. P3 has no bulk cloud ice, snow or graupel.
Namelist (new record &physics_mp_p3 in physics/Registry_p3.xml, as for
TEMPO; defaults in brackets):
config_p3_nCat number of ice categories, 1-3 [1]
config_p3_trplMomI triple-moment ice [false]
config_p3_liqfrac predicted liquid fraction of ice [false]
config_p3_predictNc double-moment cloud water [true]
config_p3_aerosols predicted nwfa/nifa [true]
config_p3_autoAccr_param warm-rain autoconversion/accretion, 1-3 [2]
config_p3_lookup_file_dir directory of the lookup tables ['.']
config_p3_cu_rc/rr/ri radii of the cloud droplets, rain drops and
ice detrained by convection
[10 um, 0.25 mm, 125 um]
config_p3_ic_bulk_ice convert initial-condition bulk ice to P3
ice at a cold start [false]
New value of an existing option: config_microp_scheme = 'mp_p3'. The
lookup tables are added in the previous commit.
MPAS side:
- Registry_p3.xml: P3 scalars (mass in the moist group, other moments in
the number group, appended), tendencies, LBC fields, diagnostics and
packages (only the scalars of the selected configuration are
allocated); aerosols reuse the generalized microphysics aerosol input
- driver_microphysics, interface, init_microphysics, todynamics,
packages: P3 driver, cold-start initialization, w at layer centres,
aerosol surface source as for Thompson, reflectivity, mp_top_level
- mpas_atmphys_p3_pblmix: the P3 scalars are mixed by YSU (with nc,
nwfa, nifa) and MYNN
- mpas_atmphys_p3_cumix: convective detrainment into the P3 scalars with
consistent number tendencies (ntiedtke, tiedtke, GF, KF)
- radiation/cloudiness: P3 effective radii via the Thompson re paths;
all P3 ice through the RRTMG snow optics
- errors (missing lookup tables, version mismatches, invalid aerosol
input) are reported via mpas_log_write
Other schemes: changes to shared code take effect only with mp_p3.
Global 30-km runs with WSM6 and Thompson are bit-for-bit with develop,
and Thompson-aerosols runs (YSU and MYNN, ntiedtke and GF) were
bit-for-bit before and after each P3 change. Tested with Intel, GNU
(debug, -fcheck=all -ffpe-trap) and nvhpc: global 30-km runs with the
P3 configurations (1-3 ice categories, triple-moment ice, liquid
fraction, with and without aerosols), restart runs, the
mesoscale_reference and convection_permitting suites, and a regional
(limited-area) run.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
First comment: TestingAll on NCAR Derecho. The global runs use the 30-km mesh (x1.655362, 55 levels) from GFS analyses at Rebase: most tests below were run before the branch was rebased onto Compilers:
Builds: make and CMake, from a fresh clone. The lookup tables are unzipped and linked automatically. P3 configurations (1- to 24-h global runs; P3 fields finite and non-negative, no errors):
Physics combinations:
Restarts: 6-h runs restarted at 3 h (P3 and Thompson) are clean. They are not bit-for-bit with the Regional: 24-h CONUS limited-area run (30 km, GFS LBCs every 3 h, GOCART aerosol climatology), P3 and Other schemes:
Cost:
7-day global runs (P3 with aerosols vs Thompson-aerosols, YSU + New Tiedtke, 2020-03-12 to 03-19):
Aerosols in the 7-day runs. The global **A convection-permitting test on a variable-resolution mesh (60-3 km): Results are summarized in a third comment below. |
Second comment: Relation to other PRs
|
|
Convection-permitting test, 60-3 km variable-resolution mesh: Two 48-h forecasts were run from GFS analyses at 2019-05-20 00 UTC on the x20.835586 mesh, which has 3-km spacing over the central US (30-43N, 106-86W). Both used the convection_permitting suite (MYNN, scale-aware Grell-Freitas), dt = 18 s and 1152 MPI tasks. One run used P3 (default: one ice category, double-moment ice, aerosols on), the other Thompson-aerosols. Both ran cleanly: 9600 steps, no critical errors, and no NaN/Inf in any output. P3 was 1.6 % more expensive in total (1.270 vs 1.250 s per step over the same 48 h), within the 2-4 % run-to-run spread of the dynamics timers, which run identical code in both. mp_p3 cost 17 % more than mp_thompson_aerosols, but microphysics is only about 6 % of the run. Over the 3-km region, precipitation is close between the schemes. The 24-h mean is 7.2 vs 6.4 mm on day 1 and 20.1 vs 20.5 mm on day 2, and almost all of it is grid-scale. P3 has a heavier upper tail (99th percentile 88 vs 66 mm on day 1, 132 vs 110 mm on day 2). Maximum composite reflectivity is lower with P3 (57-69 vs 71-81 dBZ), but the area with 1-km reflectivity above 35 dBZ is larger (e.g. 5.6 vs 4.0 % at 03 UTC on 21 May). With P3, the ice water path over the region is 20-45 % lower and the cloud liquid water path is up to about 40 % lower; rain water paths and OLR are similar. Thompson's ice is mostly snow. P3's ice is a single category whose properties evolve with the convective cycle. Its mass-weighted rime fraction is about 0.4-0.5 and bulk density about 260-280 kg m-3 during the overnight convective peak. Both fall to about 0.2 and 70-100 kg m-3 in the decaying stratiform phase. Comparison with observations has not been done yet. Aerosols and radiation on the variable-resolution mesh: The nwfa surface source (nwfa2d, shared with Thompson-aerosols; see the item on the nwfa surface source in the PR description) is proportional to areaCell, so on this mesh the emission per unit area is about 100 times weaker on the 3-km cells than on the 60-km cells (48-h column source 0.19e12 vs 21.7e12 m-2). In both schemes, nwfa therefore falls in the 3-km region (column -46 % in 48 h, P3 and Thompson-aerosols within 2 %) and grows on the 60-km part of the mesh. Removal by resolved precipitation adds to the decrease but does not cause it: columns also fall by 34 % in 3-km cells with less than 1 mm of precipitation in 48 h. On the 60-km mesh the nwfa column grows by a factor of 3.8 with P3 vs 2.1 with Thompson-aerosols. Mean in-cloud droplet number is higher with P3 by a factor of about 2.2-2.7 outside the 3-km region (e.g. 287 vs 114 cm-3 on the 60-km mesh on day 2). The factor is already 1.8-2 at 3 h, when nwfa is still the same, so it comes partly from activation and partly from the nwfa growth. Inside the 3-km region the two schemes are similar by day 2 (223 vs 216 cm-3). Daily albedo is 0.02-0.035 higher with P3 in all parts of the mesh. Outside the 3-km region this is consistent with the higher droplet numbers. Inside it, on day 2, droplet numbers are the same and P3 has less liquid and ice, so the difference there likely comes from the radiative properties of P3 ice, which we have not yet checked. |
This PR adds the Predicted Particle Properties (P3) bulk microphysics scheme (Morrison and Milbrandt 2015 and
later papers) to MPAS-Atmosphere, as the new option
config_microp_scheme = 'mp_p3'. P3 is alreadyavailable in WRF and CM1. It has no predefined ice categories such as cloud ice, snow and graupel. Instead,
one to three free ice categories each predict their total mass, number, rime mass and rime volume, and
optionally the sixth moment (triple-moment ice) and the liquid fraction. The particle properties evolve
continuously as a result. Cloud water and rain are double-moment. Optionally, P3 predicts water- and
ice-friendly aerosols (
nwfa,nifa, the same fields as Thompson-aerosols), activating droplets with the ARGscheme and using the sub-grid vertical velocity from the PBL scheme.
The P3 source (
physics_wrf/module_mp_p3.F, version 6.0.0-rc3+mpas+sbaut) is a copy of the P3 repository(jason-milbrandt/P3-microphysics). The MPAS interface started from the Stanford group's (Qi Ge and Yuan Wang) P3
implementation for MPAS v8.3.1. It was then ported to
develop, extended (PBL and convection coupling,radiation, initialization) and restructured to follow the Thompson and TEMPO code in MPAS.
The PR has three commits:
sqswhen the microphysics scheme has no snow. This fixes an upstream bug that P3exposed.
bl_mynn_pre_runzeroessqcandsqibut notsqs, so with a scheme without snow, MYNN readuninitialized memory, and P3 + MYNN results depended on the compiler. It is bit-for-bit for schemes with
snow.
GitHub's 100 MB limit unzipped). make and CMake unzip them at build time and link them to the top-level
directory, and
setup_run_dir.pylinks them into run directories. Table versions are in the filenames andare checked by P3 when reading them.
New namelist options
These are in a new record
&physics_mp_p3, defined inphysics/Registry_p3.xmlas for TEMPO; defaults are inbrackets.
config_p3_nCatconfig_p3_trplMomIconfig_p3_liqfracconfig_p3_predictNcconfig_p3_aerosolsnwfa/nifa[true]; requiresconfig_p3_predictNc = trueconfig_p3_autoAccr_paramconfig_p3_lookup_file_dirconfig_p3_cu_rc,config_p3_cu_rr,config_p3_cu_riconfig_p3_ic_bulk_iceqi+qs+qg) in the initial conditions to P3 ice at a cold start [false]New value of an existing option:
config_microp_scheme = 'mp_p3'.New input files: the P3 lookup tables, which are supplied with the code; nothing to download.
Input fields: with
config_p3_aerosols = true, the same GOCART climatology fields as Thompson-aerosols(
nwfa,nifa,nwfa2d,nifa2d) frominit_atmosphere. There are no changes toinit_atmosphereexcept a package description.
Changes on the MPAS side
physics/Registry_p3.xml(new):p3_qit*) is in themoistgroup, so it counts in the condensate loading.numbergroup. They are subsets or moments ofp3_qit, so putting them inmoistwould double-count the mass.qi,qs,qgorni. The PBL, convection, cloud-fraction and radiation schemes seeqias the sum over the P3 ice categories.init_microphysics,todynamics, packages:kzh/l; output assigw_p3)diag_zemp_top_levelhandlingp3_rhoi,p3_vmiandp3_dmi(not in default streams)mpas_atmphys_p3_pblmix.F(new): YSU and MYNN mix the P3 ice scalars, as they mixqifor the other schemes.nc,nwfaandnifa; MYNN already mixes these.bl_ysu_run(module_bl_ysu.F). Without them, YSU is unchanged.mpas_atmphys_p3_cumix.F(new): cumulus detrainment of cloud water, ice and (Kain-Fritsch) rain goesinto the P3 scalars with consistent number tendencies (droplet, drop and ice sizes from
config_p3_cu_*).config_p3_ic_bulk_iceis set.driver_cloudiness,driver_radiation_sw/lw):config_microp_re).re_ice, because P3 ice spans the sizes of cloudice and snow.
re_ice= 130 µm (the limit of the RRTMG snow optics), the ice mass passed to radiation is scaledby 130/
re_ice, which keeps the optical depth.config_p3_aerosols, the aerosol optical depth uses Thompson'sgt_aod.-Dmpas, all P3 messages go throughmpas_log_write. A missing lookup table, atable-version mismatch or invalid aerosol input aborts with
MPAS_LOG_CRIT, naming the file or the values.Tables are read on rank 0 and broadcast.
Other schemes: all changes to shared code take effect only with
mp_p3. Where shared code wasrestructured, other schemes are unaffected, as tested bit-for-bit:
ncvsnifa/nwfasplit of the PBL tendencies indriver_pblcaselists in the radiation driversifblocks in the interfaceGlobal runs with WSM6 and Thompson are bit-for-bit with
develop.Release note
Added the Predicted Particle Properties (P3) microphysics scheme (
config_microp_scheme = 'mp_p3') with one tothree free ice categories, optional triple-moment ice and liquid fraction, and optional predicted aerosols. Its options are in the new namelist record
&physics_mp_p3, and its lookup tables are included and installed at build time.Open questions for the MPAS developers (mainly related to Thompson aerosol-aware)
These came up while coupling P3. Most concern Thompson or shared MPAS code. P3 handles them as described here,
and nothing was changed for the other schemes.
YSU does not mix number concentrations for Thompson. In
driver_pbl, YSU mixes only qv, qc and qi. For Thompson,nc,ni,nwfaandnifaare not mixed, though MYNN mixes them. So qc and qi are mixed without theirnumbers, and the aerosol surface source piles up in the lowest level. For P3, YSU mixes the P3 ice scalars
and
nc,nwfaandnifa. This is the main reasonnwfagrows much faster with P3 + YSU than withThompson-aerosols + YSU (next item).
Convective detrainment has no number tendencies for Thompson. The convection schemes return mass tendencies only, so for Thompson the detrained mass changes qc, qi and qr but not
nc,niandnr. P3 adds consistent numbers.LBCs for microphysics variables (all MP schemes).
init_atmospherewrites LBCs only for qv, qc, qr,nwfaandnifa. All other microphysics variables, including all P3 ice scalars, are zero in the specified zone. When thedriving data contain qc and qr, these enter with
nc = nr = 0. This is the same for P3 and Thompson (genericscalar code) and was not changed.
No
nifasource (both Thompson and P3).nifa2dis zero, sonifaonly decreases. The P3 floor of 1e5 kg-1 is written back and so acts as a source. A climatology-based source for both schemes would be preferable.The
nwfasurface source has no matching sink (both Thompson and P3).nwfa2dis added to the lowest level everymicrophysics step. It is fixed in time (computed from the initial
nwfa) and scales with the mass of thelowest layer, so the flux depends on resolution. In the 30-km global tests it is 2.6e12 m-2 day-1, about
45 % of the initial
nwfacolumn per day. For Thompson-aerosols, the only thing that removesnwfaat acomparable rate is the 9.999e9 kg-1 cap. The cap is applied only in columns with active microphysics, and
the source is added after it, so the lowest level often exceeds the cap (regional test: 77-88 % of
lowest-level points at 12-24 h). With YSU,
nwfais not mixed out of the lowest level. That level staysat the cap (global median 1.0e10 kg-1 at days 1-2), and the cap removes most of the source. With MYNN,
which mixes
nwfa, Thompson-aerosols keeps most of the source as well. Fraction of the source retained inthe global
nwfacolumn (30 km, same initial conditions):The steady
nwfaof Thompson-aerosols + YSU therefore comes from the cap acting on unmixed air in thelowest level, not from a physical sink. P3 uses the same source and mixes
nwfawith both PBL schemes. Itsupper limit (1e11 kg-1) affects only about 0.1 % of the
nwfamass, so P3 keeps most of the source: theglobal column grows by a factor of 3.7 in 7 days, which raises droplet numbers and reflected shortwave
(see the Testing comment). The source is shared with Thompson-aerosols, so we did not change it here.
Possible fixes include relaxation toward a background or climatology (as in the GEM interface to P3), an
explicit sink such as dry deposition, or a resolution-independent flux. We are also discussing this with
the Stanford group.
Possible additional upstream issues (not changed here):
bl_mynn_pre.F:sqs = qs/(1+qs)should probably beqs/(1+qv). Fixing it would change the results ofschemes with snow.
module_cu_gf.mpas.F(cup_gf_sh):qco(i,ktop+1)is read uninitialized. It is multiplied by zero, so harmless, but it traps with Intel-init=snan.