Complete CCPPization of BAM/MAM aerosol optics; BAM microp_aero (nucleate_ice; ndrop_bam; inline logic in microp_aero)#398
Conversation
…sol interface Draft: wire up aerosol optics to rrtmgp Move nswbands, nlwbands to host side namelist wire up aerosol_optics in cam4 suite to cherry-pick: remove constituent diag in prescribe_volcanic_aerosol fix dim diagnostic test; try to move radiative_aerosol_definitions to metadata instead of host-model dep Fix idxnite not in rrtmgp_pre before running aerosol_optics; add ODV diags for bulk aerosol
…r lbound of assumed-shape arrays
Assisted-by: claude-opus:4.6
…ol from pbuf_ N fields
| ! Reset per-species accumulators for this bin/level | ||
| scatdust_d(:ncol) = 0._kind_phys; absdust_d(:ncol) = 0._kind_phys; hygrodust_d(:ncol) = 0._kind_phys | ||
| scatbc_d(:ncol) = 0._kind_phys; absbc_d(:ncol) = 0._kind_phys; hygrobc_d(:ncol) = 0._kind_phys | ||
| scatsulf_d(:ncol) = 0._kind_phys; abssulf_d(:ncol) = 0._kind_phys; hygrosulf_d(:ncol) = 0._kind_phys | ||
| scatpom_d(:ncol) = 0._kind_phys; abspom_d(:ncol) = 0._kind_phys; hygropom_d(:ncol) = 0._kind_phys | ||
| scatsoa_d(:ncol) = 0._kind_phys; abssoa_d(:ncol) = 0._kind_phys; hygrosoa_d(:ncol) = 0._kind_phys | ||
| scatsslt_d(:ncol) = 0._kind_phys; abssslt_d(:ncol) = 0._kind_phys; hygrosslt_d(:ncol) = 0._kind_phys |
There was a problem hiding this comment.
A note that these variables of the code is intentionally hardcoded to match CAM aerosol_optics_cam.F90 and will be refactored in the future in CAM to be namelist-driven.
…ed_on_main Portable microp_aero code (ndrop_bam, nucleate_ice, subgrid vertical velocity and dust radii interstitials) landed in main via ESCOMP#411 with review changes; take main's versions for all overlapping files. Update ndrop_bam_ccpp_init for the errmsg/errflg arguments added to ndrop_bam_init during review.
Provenance: FIX-26 octopus Assisted-by: claude-fable:5
Automated coding-standards reviewThis is an automated review of the changed code against the project's Fortran coding-standards checklist ( Rule 7 —
|
|
Thanks @nusbaume - automated comments resolved |
| write(iulog,*) subname//': did not find sslt1/2/3/4 and will not rebin seasalt to SSLTA/SSLTC' | ||
| end if | ||
| return |
There was a problem hiding this comment.
A note that this is intended to be non-fatal. It is used for BAM only.
| ! | ||
| ! Safe to use with use_hetfrz_classnuc=.true. for snapshot-testing flows where | ||
| ! the flag must propagate downstream; a warning is printed at init time. | ||
| module hetfrz_classnuc_stub |
There was a problem hiding this comment.
This stub serves both microp_aero and PUMAS, so whichever goes in first.
| call ndrop_bam_calc( & | ||
| aero_state = aero_state_bam, & | ||
| aero_props = aero_props_bam, & |
There was a problem hiding this comment.
This contraption brought to you because the framework is currently unable to handle abstract classes like this being passed into the schemes; also, we need to resolve the BAM aerosol state/props from all the potentially active states (more than one can be active at a time.)
This pattern of having a CCPP marshal will be predominant in the BAM/MAM work in the future.
| !! \htmlinclude ndrop_bam_diagnostics_init.html | ||
| subroutine ndrop_bam_diagnostics_init(errmsg, errflg) | ||
| use cam_history, only: history_add_field | ||
| use ndrop_bam, only: aername |
There was a problem hiding this comment.
There is no elegant way to get the bulk aerosol names but sourcing it from the portable code is the best I could think of. The other way would be to scan rad_aer_climate from the host radiative_aerosol_definitions which seems more hassle. This is consistent with how CAM does the addflds.
| intent = in | ||
| [ tke ] | ||
| standard_name = specific_turbulent_kinetic_energy_at_interfaces | ||
| standard_name = tke_at_interfaces |
There was a problem hiding this comment.
Name updated to match UW PBL. Missed this in the last PR.
| index(cnst_name, 'NUMLIQ') > 0 .or. & ! micro_pumas_cam if modal/trop_strat carma | ||
| index(cnst_name, 'mass_number_concentration_of_cloud_liquid_wrt_moist_air_and_condensed_water') > 0) then |
There was a problem hiding this comment.
These are one and the same, but before it was NUMLIQ if it was not in the registry; if it is in the registry, it becomes the actual standard name.
I would not spend too much pondering the utility of this subroutine; it will be eliminated after dropmixnuc is CCPPized, and this is supposed to be a custom constituent property, not a logical array.
| ! Unified CCPP scheme for ice nucleation via the nucleati kernel. | ||
| ! Uses the abstract interface to support BAM, MAM, and CARMA. | ||
| ! | ||
| ! This scheme replaces nucleate_ice_cam_calc for CAM-SIMA. | ||
| module nucleate_ice_ccpp |
There was a problem hiding this comment.
Same pattern as ndrop_bam_ccpp.
This module supports all aerosol models (BAM/MAM/CARMA)
…bed schemes; diagnostic names in sima_state_diagnostics) into bulk_aero_3_rebased_on_main
…e interface. The diagnostic-list water uptake in modal_aerosol_state (CAM-SIMA) takes t, pmid, h2ommr, cldn and top_lev; thread them through the scheme and the two per-species diagnostic calls.
In CAM these are pbuf fields (qqcw) and never reach the diffusion constituent loop; CAM-SIMA registers them as constituents, so they must be excluded by name like the interstitial modal species.
Mirrors physics_update's qneg3 label in CAM ('nucleatei').
…he MAM-side prescribed_stratospheric_aerosol.
CAM computes relative humidity for the optics table lookup inline in aerosol_optics_cam; in CAM-SIMA cam4/cam5 it comes from compute_cloud_fraction, which cam7 does not run, so capgen found no provider for relative_humidity. The water vapor constituent is resolved by standard name instead of CAM's fixed constituent index 1.
The cam7 cap declares scheme locals by local name, so nucleate_ice's ni (cloud ice number concentration) collides with the gravity wave drag schemes' ni (interface Brunt-Vaisala frequency) and the cap fails to compile. Local-name collisions across schemes with different standard names are a capgen issue to raise upstream; renaming ours unblocks cam7.
Tag name:
Originator(s): @jimmielin
Description:
microp_aeroschemes for BAM in CAM-SIMA; shared code with CAM.Companion CAM-SIMA PR: ESCOMP/CAM-SIMA#504
List all namelist files that were added or changed:
List all files eliminated and why: N/A
List all files added and what they do:
List all existing files that have been modified, and describe the changes:
List all automated tests that failed, as well as an explanation for why they weren't fixed:
Is this an answer-changing PR? If so, is it a new physics package, algorithm change, tuning change, etc?
New physics package
CAM regression tests for shared code
SIMA snapshot tests for microp_aero
Eyeballed the results from aerosol optics and looked reasonable.
If yes to the above question, describe how this code was validated with the new/modified features: