Skip to content

Move refactored portable science code for Modal Aerosol Model (MAM), aero wetdep, aero drydep to atmos_phys - #433

Draft
jimmielin wants to merge 5 commits into
ESCOMP:mainfrom
jimmielin:hplin/mam_atmos_phys
Draft

Move refactored portable science code for Modal Aerosol Model (MAM), aero wetdep, aero drydep to atmos_phys#433
jimmielin wants to merge 5 commits into
ESCOMP:mainfrom
jimmielin:hplin/mam_atmos_phys

Conversation

@jimmielin

@jimmielin jimmielin commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Tag name (The PR title should also include the tag name):
Originator(s): @jimmielin coauthored with claude-fable:5, claude-opus:4.6, claude-opus:4.8, claude-opus:5, gpt-sol:5.6[xhigh] [see AI disclosure below]

Description (include issue title and the keyword ['closes', 'fixes', 'resolves'] and issue number):
Includes portable science subroutines of the following aerosol code:

  • MAM calcsize, wateruptake, gasaerexch, rename (mode merging), newnuc, coag
  • MAM setsox (+ cldaero/sox_cldaero)
  • Aerosol wetdep, convproc
  • Aerosol drydep
  • microp_aero MAM/CARMA block activate_aerosol core, ndrop, dropmixnuc
  • Dust and seasalt emissions plus supporting dust_common, sslt_sections

CCPP wrappers to follow.

AI disclosure: The below portable science subroutines were spliced from their original CAM counterparts byte-for-byte, then later linted to fit atmos_phys requirements without changing existing functionality.

The portable science subroutines were generated by

  1. Taking the original CAM code and removing dependencies based on the CCPP conversion procedures,
  2. Splicing the core science code into the destination file in atmos_phys
  3. Verifying that the copied code is byte-for-byte identical after normalization (collapsing all comments and whitespace, kind_phys to r8)

The following is a summary of where everything came and went:

Original CAM file (cam6_4_195) Moved to atmos_phys Remnant CAM interface Notes
utils/modal_aero_calcsize.F90 schemes/modal_aero/modal_aero_calcsize.F90 utils/modal_aero_calcsize_cam.F90 (_reg, _init) _submodal_aero_calcsize_run, _diag_diag_run, calcdry_calcdry_run
utils/modal_aero_wateruptake.F90 schemes/modal_aero/modal_aero_wateruptake.F90 (_sub, Kohler solvers, H2SO4 equilib helpers; names unchanged) utils/modal_aero_wateruptake_cam.F90 (_dr driver: pbuf, PM/history diagnostics)
modal_aero/modal_aero_gasaerexch.F90 schemes/modal_aero/modal_aero_gasaerexch.F90 (+ .meta) modal_aero/modal_aero_gasaerexch_cam.F90 (_cam_init) _submodal_aero_gasaerexch_run
modal_aero/modal_aero_rename.F90 schemes/modal_aero/modal_aero_rename.F90 (variant subs unchanged) modal_aero/modal_aero_rename_cam.F90 (_cam_init) dispatcher _submodal_aero_rename_run
modal_aero/modal_aero_newnuc.F90 schemes/modal_aero/modal_aero_newnuc.F90 modal_aero/modal_aero_newnuc_cam.F90 (_cam_init) _submodal_aero_newnuc_run
modal_aero/modal_aero_coag.F90 schemes/modal_aero/modal_aero_coag.F90 (incl. CMAQ getcoags) modal_aero/modal_aero_coag_cam.F90 (_cam_init) _submodal_aero_coag_run
aerosol/mo_setsox.F90 schemes/modal_aero/mo_setsox.F90 (setsox_init, setsox_sub) aerosol/mo_setsox_cam.F90 (sox_inti + setsox wrapper marshaling aerosol_state) original setsox body = portable setsox_sub
aerosol/cldaero_mod.F90, aerosol/sox_cldaero_mod.F90 fully moved to schemes/modal_aero/
aerosol/wetdep.F90 schemes/modal_aero/wetdep.F90 (clddiag, wetdepa_v1/v2) aerosol/wetdep_cam.F90 (wetdep_init, wetdep_inputs_set, wetdepg)
aerosol/aero_convproc.F90 schemes/modal_aero/aero_convproc.F90 (activate/resuspend/precpevap; names unchanged) aerosol/aero_convproc_cam.F90 (_readnl, _init, _dp_intr, _intr) aero_convproc_tendaero_convproc_run
aerosol/aer_drydep_mod.F90 (deleted) + modal_aero_depvel_part from modal_aero/aero_model.F90 schemes/modal_aero/aero_drydep_core.F90 (modal_aero_depvel_part, calcram) drydep drivers remain in per-package aero_model.F90 calcram takes rair/gravit explicitly (removes inidrydep module state); d3ddflux uses replaced by the portable sediment-flux path; setdvel/ddflux were unreferenced
aerosol/dust_sediment_mod.F90, aerosol/dust_common.F90, aerosol/sslt_sections.F90 moved whole to schemes/modal_aero/
modal_aero/dust_model.F90 (dust_emis) schemes/modal_aero/modal_dust_emissions.F90 thin call in dust_model.F90 dust_emismodal_dust_emissions_run
modal_aero/seasalt_model.F90 (seasalt_emis) schemes/modal_aero/modal_seasalt_emissions.F90 thin call in seasalt_model.F90 seasalt_emismodal_seasalt_emissions_run
physics/cam/ndrop.F90 schemes/microp_aero/ndrop.F90 (ndrop_init, dropmixnuc, explmix, ccncalc); activate_aerosolschemes/modal_aero/aero_activate.F90 callers rewired in physics/cam/microp_aero.F90

List all namelist files that were added or changed:

List all files eliminated and why:

List all files added and what they do:

List all existing files that have been modified, and describe the changes:
(Helpful git command: git diff --name-status main...<your_branch_name>)

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?

If yes to the above question, describe how this code was validated with the new/modified features:

Haipeng Lin and others added 5 commits August 10, 2026 11:59
…drop

Verbatim copies (r8 swept to kind_phys) of the portable science split out of
CAM's modal aerosol code: calcsize, wateruptake, gasaerexch, rename, newnuc,
coag, setsox (+ cldaero/sox_cldaero), wetdep, convproc, activate, drydep
(+ dust_sediment), dust + seasalt emissions (+ dust_common/sslt_sections),
and ndrop (dropmixnuc). Bit-for-bit validated in CAM regression testing on
the CAM-side refactor branch and per-scheme against CAM snapshots in
CAM-SIMA. CAM builds these files directly through the atmos_phys external;
CCPP wrappers and suite infrastructure follow in later PRs.
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.

2 participants