@@ -199,14 +199,6 @@ void MAMMicrophysics::set_grids(
199
199
// - extfrc: 3D instantaneous forcing rate [kg/m³/s]
200
200
add_field<Computed>(" mam4_external_forcing" , vector3d_extcnt, kg / m3 / s, grid_name);
201
201
202
- // Diagnostic fluxes
203
- const FieldLayout vector2d_nmodes =
204
- grid_->get_2d_vector_layout (nmodes, " nmodes" );
205
-
206
- // Register computed diagnostic fields
207
- add_field<Computed>(" dqdt_so4_aqueous_chemistry" , vector2d_nmodes, kg/m2/s, grid_name);
208
- add_field<Computed>(" dqdt_h2so4_uptake" , vector2d_nmodes, kg/m2/s, grid_name);
209
-
210
202
// Diagnostic fields for aerosol microphysics
211
203
212
204
// Flag to indicate if we want to compute extra diagnostics
@@ -215,6 +207,9 @@ void MAMMicrophysics::set_grids(
215
207
const FieldLayout vector3d_num_gas_aerosol_constituents =
216
208
grid_->get_3d_vector_layout (true , mam_coupling::gas_pcnst (), " num_gas_aerosol_constituents" );
217
209
210
+ const FieldLayout vector2d_nmodes =
211
+ grid_->get_2d_vector_layout (nmodes, " nmodes" );
212
+
218
213
// Diagnostics: tendencies due to gas phase chemistry [mixed units: kg/kg/s or #/kg/s]
219
214
add_field<Computed>(" mam4_microphysics_tendency_gas_phase_chemistry" , vector3d_num_gas_aerosol_constituents, nondim, grid_name);
220
215
@@ -227,6 +222,12 @@ void MAMMicrophysics::set_grids(
227
222
// Diagnostics: H2SO4 in-cloud tendencies [mixed units: kg/kg/s or #/kg/s]
228
223
add_field<Computed>(" mam4_microphysics_tendency_aqh2so4" , vector3d_mid_nmodes, nondim, grid_name);
229
224
225
+ // Register computed diagnostic fields
226
+ // (NOTE: dqdt_so4_aqueous_chemistry is the vertically reduced field of "mam4_microphysics_tendency_aqso4")
227
+ add_field<Computed>(" dqdt_so4_aqueous_chemistry" , vector2d_nmodes, kg/m2/s, grid_name);
228
+ // (NOTE: dqdt_h2so4_uptake is the vertically reduced field of "mam4_microphysics_tendency_aqh2so4")
229
+ add_field<Computed>(" dqdt_h2so4_uptake" , vector2d_nmodes, kg/m2/s, grid_name);
230
+
230
231
// Diagnostics: tendencies due to aerosol microphysics (gas aerosol exchange) [mixed units: mol/mol/s or #/mol/s]
231
232
add_field<Computed>(" mam4_microphysics_tendency_condensation" , vector3d_num_gas_aerosol_constituents, nondim, grid_name);
232
233
add_field<Computed>(" mam4_microphysics_tendency_renaming" , vector3d_num_gas_aerosol_constituents, nondim, grid_name);
@@ -490,7 +491,6 @@ void MAMMicrophysics::initialize_impl(const RunType run_type) {
490
491
{" sfc_alb_dir_vis" , {-1e10 , 1e10 }}, // FIXME
491
492
{" snow_depth_land" , {-1e10 , 1e10 }}, // FIXME
492
493
{" surf_radiative_T" , {-1e10 , 1e10 }}, // FIXME
493
- {" dqdt_so4_aqueous_chemistry" , {-1e10 , 1e10 }}, // FIXME
494
494
{" dqdt_h2so4_uptake" , {-1e10 , 1e10 }} // FIXME
495
495
};
496
496
set_ranges_process (ranges_microphysics);
@@ -711,18 +711,17 @@ void MAMMicrophysics::run_impl(const double dt) {
711
711
const const_view_1d snow_depth_land =
712
712
get_field_in (" snow_depth_land" ).get_view <const Real *>();
713
713
714
- // Constituent fluxes
715
- view_2d aqso4_flx = get_field_out (" dqdt_so4_aqueous_chemistry" ).get_view <Real **>();
716
- view_2d aqh2so4_flx = get_field_out (" dqdt_h2so4_uptake" ).get_view <Real **>();
717
-
718
714
// - dvmr/dt: Tendencies for mixing ratios [kg/kg/s]
715
+ view_2d dqdt_so4_aqueous_chemistry, dqdt_h2so4_uptake;
719
716
view_3d gas_phase_chemistry_dvmrdt, aqueous_chemistry_dvmrdt;
720
717
view_3d aqso4_incloud_mmr_tendency, aqh2so4_incloud_mmr_tendency;
721
718
view_3d gas_aero_exchange_condensation, gas_aero_exchange_renaming,
722
719
gas_aero_exchange_nucleation, gas_aero_exchange_coagulation,
723
720
gas_aero_exchange_renaming_cloud_borne;
724
721
725
722
if (extra_mam4_aero_microphys_diags_) {
723
+ dqdt_so4_aqueous_chemistry = get_field_out (" dqdt_so4_aqueous_chemistry" ).get_view <Real **>();
724
+ dqdt_h2so4_uptake = get_field_out (" dqdt_h2so4_uptake" ).get_view <Real **>();
726
725
gas_phase_chemistry_dvmrdt = get_field_out (" mam4_microphysics_tendency_gas_phase_chemistry" ).get_view <Real ***>();
727
726
aqueous_chemistry_dvmrdt = get_field_out (" mam4_microphysics_tendency_aqueous_chemistry" ).get_view <Real ***>();
728
727
aqso4_incloud_mmr_tendency = get_field_out (" mam4_microphysics_tendency_aqso4" ).get_view <Real ***>();
@@ -997,9 +996,11 @@ void MAMMicrophysics::run_impl(const double dt) {
997
996
mam4::MicrophysDiagnosticArrays diag_arrays;
998
997
999
998
if (extra_mam4_aero_microphys_diags) {
1000
- diag_arrays.gas_phase_chemistry_dvmrdt = ekat::subview (gas_phase_chemistry_dvmrdt, icol);
999
+ diag_arrays.dqdt_so4_aqueous_chemistry = ekat::subview (dqdt_so4_aqueous_chemistry, icol);
1000
+ diag_arrays.dqdt_h2so4_uptake = ekat::subview (dqdt_h2so4_uptake, icol);
1001
+ diag_arrays.gas_phase_chemistry_dvmrdt = ekat::subview (gas_phase_chemistry_dvmrdt, icol);
1001
1002
1002
- diag_arrays.aqueous_chemistry_dvmrdt = ekat::subview (aqueous_chemistry_dvmrdt, icol);
1003
+ diag_arrays.aqueous_chemistry_dvmrdt = ekat::subview (aqueous_chemistry_dvmrdt, icol);
1003
1004
diag_arrays.aqso4_incloud_mmr_tendency = ekat::subview (aqso4_incloud_mmr_tendency, icol);
1004
1005
diag_arrays.aqh2so4_incloud_mmr_tendency = ekat::subview (aqh2so4_incloud_mmr_tendency, icol);
1005
1006
@@ -1008,7 +1009,7 @@ void MAMMicrophysics::run_impl(const double dt) {
1008
1009
diag_arrays.gas_aero_exchange_nucleation = ekat::subview (gas_aero_exchange_nucleation, icol);
1009
1010
diag_arrays.gas_aero_exchange_coagulation = ekat::subview (gas_aero_exchange_coagulation, icol);
1010
1011
diag_arrays.gas_aero_exchange_renaming_cloud_borne = ekat::subview (gas_aero_exchange_renaming_cloud_borne, icol);
1011
- }
1012
+ }
1012
1013
1013
1014
1014
1015
// Wind speed at the surface
@@ -1053,8 +1054,6 @@ void MAMMicrophysics::run_impl(const double dt) {
1053
1054
}
1054
1055
}
1055
1056
// These output values need to be put somewhere:
1056
- const auto aqso4_flx_col = ekat::subview (aqso4_flx, icol); // deposition flux of so4 [mole/mole/s]
1057
- const auto aqh2so4_flx_col = ekat::subview (aqh2so4_flx, icol); // deposition flux of h2so4 [mole/mole/s]
1058
1057
Real dflx_col[num_gas_aerosol_constituents] = {}; // deposition velocity [1/cm/s]
1059
1058
Real dvel_col[num_gas_aerosol_constituents] = {}; // deposition flux [1/cm^2/s]
1060
1059
// Output: values are dvel, dflx
@@ -1073,8 +1072,7 @@ void MAMMicrophysics::run_impl(const double dt) {
1073
1072
offset_aerosol,
1074
1073
dry_diameter_icol, wet_diameter_icol,
1075
1074
wetdens_icol, dry_atm.phis (icol), cmfdqr, prain_icol, nevapr_icol,
1076
- work_set_het_icol, drydep_data, aqso4_flx_col, aqh2so4_flx_col,
1077
- diag_arrays, dvel_col, dflx_col, progs);
1075
+ work_set_het_icol, drydep_data, diag_arrays, dvel_col, dflx_col, progs);
1078
1076
1079
1077
team.team_barrier ();
1080
1078
// Update constituent fluxes with gas drydep fluxes (dflx)
0 commit comments