E3SM-Project / E3SM-Project/ACME-ECP

Inconsistency in MODAL_AERO and nmodes when modal aerosols are not used?

Open
#43 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Fortran
Stars
11
Forks
2
PR merge metrics
No merged PRs in 30d

Description

This issue came up when trying to run the MPACEB SCM case with SP-EAM flags. For this case, chem is set to none, so the chemistry/modal_aero source code directory is not added to the build, and the MODAL_AERO preprocessor flag is not defined. Thus, fields in crm_physics and crm_module related to modal aerosols are not defined, because ntot_amodes will not be defined. However, in physpkg, activation of modal aerosols affecting the climate is checked by counting nmodes in the rad_constituents interface:
```
! Determine whether its a 'modal' aerosol simulation or not
call rad_cnst_get_info(0, nmodes=nmodes)
clim_modal_aero = (nmodes > 0)
```
The `clim_modal_aero` flag is then checked in multiple places to determine whether or not to call modal aerosol routines. Where this causes problems is in the `bc_aerosols` part of the SP-EAM block in `tphysbc`, where this determines whether or not `modal_aero_wateruptake_dr` is called. However, for some reason, `rad_cnst_get_info(nmodes=nmodes)` returns `nmodes == 3` in this case, so `clim_modal_aero` is true, and thus these modal aerosol routines do get called here. The problem is that within `modal_aero_wateruptake_dr`, it is assumed that CRM fields related to modal aerosols are defined, so this would require an additional `ifdef MODAL_AERO` block either in `modal_aero_waterupdate_dr` or in `tphysbc`. But the real problem is that this seems pretty misleading. One would think that `clim_modal_aero` should be false if modal aerosols should not be in use (implied by `MODAL_AERO` not being defined), but this is not the case, and in fact these two logicals seem to be contradictory when chem is none. I’m not sure what the ideal solution is here, because the aerosol interface is somewhat confusing to me. I hesitate to suggest adding more ifdefs here. Maybe the better thing to do is to define the CRM aerosol fields on pbuf even when MODAL_AERO is not defined, and in that case getting the number of modes from the rad_constituents interface like is done in `tphysbc`?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.