DRAFT - WIP on adding diagnostic output for `*_sfgaex1, *_sfgaex2, *_sfnnuc, *_sfcoag`
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
nqtendaaandnqqcwtendaa, and theiqtend_<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_tendaaandqqcwgcm_tendaaare calculated withinmam4_amicphys.hppbyget_gcm_tend_diags_from_subareas()which is called bymodal_aero_amicphys_intr().- Therein, a weighted sum of the sub-area tendencies
qsub_tendaaandqqcwsub_tendaaare accumulated intoqgcm_tendaaandqqcwgcm_tendaa
- Therein, a weighted sum of the sub-area tendencies
- 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?
- From the fortran, I've found the following
- [ ] @mahf708 - would it be better to do the work of
process_diagnostic_tendencies()invert_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
boolflags 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?
+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.
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
Closing, reimplemented it in #7492