E3SM-Project / ACME-ECP

E3SM MMF for DoE ECP project
Other
9 stars 1 forks source link

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

Open brhillman opened 6 years ago

brhillman commented 6 years ago

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?