E3SM icon indicating copy to clipboard operation
E3SM copied to clipboard

DRAFT - WIP on adding diagnostic output for `*_sfgaex1, *_sfgaex2, *_sfnnuc, *_sfcoag`

Open mjschmidt271 opened this issue 7 months ago • 1 comments

This is a rough first cut that I'm hoping to get some feedback from...

Currently, eamxx_mam_microphysics.<x>pp calls mam4::microphysics::perform_atmospheric_chemistry_and_microphysics() within a column-wise par-for. As of this PR, the function now returns qgcm_tendaa and qqcwgcm_tendaa, which are "grid-cell mean tracer mixing ratios," and calculated within mam4::microphysics::modal_aero_amicphys_intr().

Once the columns of grid-cell means are returned to EAMxx, they are sent to a new function process_diagnostic_tendencies() to apply the proper cell-wise (level-wise) weights to column-integrate these quantities.

Questions

  • [ ] The third dimension of the 3d arrays/views holding the grid-cell means has extent nqtendaa and nqqcwtendaa, and the iqtend_<xyz> index in this dimension indicates what sort of quantity it holds.
    • From the fortran, I've found the following
      nqtendaa = 4
      nqqcwtendaa = 1
      iqtend_cond = 1
      iqtend_rnam = 2
      iqtend_nnuc = 3
      iqtend_coag = 4
      
    • In MAM4xx, qgcm_tendaa and qqcwgcm_tendaa are calculated within mam4_amicphys.hpp by get_gcm_tend_diags_from_subareas() which is called by modal_aero_amicphys_intr().
      • Therein, a weighted sum of the sub-area tendencies qsub_tendaa and qqcwsub_tendaa are accumulated into qgcm_tendaa and qqcwgcm_tendaa
    • I haven't yet looked deeper than this to see how the sub-area quantities are calculated for each iqtend_<xyz>
    • Are these quantities the ones we are looking for--e.g., *_sfgaex1, *_sfgaex2, *_sfnnuc, *_sfcoag?
  • [ ] @mahf708 - would it be better to do the work of process_diagnostic_tendencies() in vert_contract.<x>pp? Or potentially add a custom version, since the required weights may not fit nicely into what's there?
  • [ ] Right now, I've got a couple of very hacky bool flags that control whether we write the quantities to file.
    • I know we're not looking to be fancy in the short-term, but what seems best for now?

mjschmidt271 avatar Jun 19 '25 00:06 mjschmidt271

+1 to @mahf708 's EXECUTIVE ACTION suggestion for better naming. The legacy names can be retained (if needed) within mam4xx for maintaining the parameterizations, but this is a logical place to map them to more transparent equivalents.

jeff-cohere avatar Jun 19 '25 19:06 jeff-cohere

This appears to be working, though it required some slightly ugly workarounds that may be incompatible with @overfelt 's changes.

I'll wait on feedback and resolve those as we converge on the approach

mjs271 avatar Jun 27 '25 23:06 mjs271

Closing, reimplemented it in #7492

singhbalwinder avatar Jul 15 '25 23:07 singhbalwinder