@@ -164,8 +164,12 @@ void MAMMicrophysics::set_grids(
164
164
// Diagnostic fluxes
165
165
const FieldLayout vector2d_nmodes =
166
166
grid_->get_2d_vector_layout (nmodes, " nmodes" );
167
- add_field<Computed>(" dqdt_so4_aqueous_chemistry" , vector2d_nmodes, kg/m2/s, grid_name);
168
- add_field<Computed>(" dqdt_h2so4_uptake" , vector2d_nmodes, kg/m2/s, grid_name);
167
+
168
+ extra_mam4_diags_ = m_params.get <bool >(" extra_mam4_diags" , false );
169
+ if (extra_mam4_diags_) {
170
+ add_field<Computed>(" dqdt_so4_aqueous_chemistry_column_integrated_flux" , vector2d_nmodes, kg/m2/s, grid_name);
171
+ add_field<Computed>(" dqdt_h2so4_aqueous_chemistry_column_integrated_flux" , vector2d_nmodes, kg/m2/s, grid_name);
172
+ }
169
173
170
174
// ---------------------------------------------------------------------
171
175
// These variables are "updated" or inputs/outputs for the process
@@ -451,7 +455,8 @@ void MAMMicrophysics::initialize_impl(const RunType run_type) {
451
455
{" sfc_alb_dir_vis" , {-1e10 , 1e10 }}, // FIXME
452
456
{" snow_depth_land" , {-1e10 , 1e10 }}, // FIXME
453
457
{" surf_radiative_T" , {-1e10 , 1e10 }}, // FIXME
454
- {" dqdt_so4_aqueous_chemistry" , {-1e10 , 1e10 }}, // FIXME
458
+ {" dqdt_so4_aqueous_chemistry_column_integrated_flux" , {-1e10 , 1e10 }}, // FIXME
459
+ {" dqdt_h2so4_aqueous_chemistry_column_integrated_flux" , {-1e10 , 1e10 }}, // FIXME
455
460
{" dqdt_h2so4_uptake" , {-1e10 , 1e10 }} // FIXME
456
461
};
457
462
set_ranges_process (ranges_microphysics);
@@ -634,8 +639,12 @@ void MAMMicrophysics::run_impl(const double dt) {
634
639
get_field_in (" snow_depth_land" ).get_view <const Real *>();
635
640
636
641
// Constituent fluxes
637
- view_2d aqso4_flx = get_field_out (" dqdt_so4_aqueous_chemistry" ).get_view <Real **>();
638
- view_2d aqh2so4_flx = get_field_out (" dqdt_h2so4_uptake" ).get_view <Real **>();
642
+ view_2d aqso4_flx;
643
+ view_2d aqh2so4_flx;
644
+ if (extra_mam4_diags_) {
645
+ aqso4_flx = get_field_out (" dqdt_so4_aqueous_chemistry_column_integrated_flux" ).get_view <Real **>();
646
+ aqh2so4_flx = get_field_out (" dqdt_h2so4_aqueous_chemistry_column_integrated_flux" ).get_view <Real **>();
647
+ }
639
648
640
649
// climatology data for linear stratospheric chemistry
641
650
// ozone (climatology) [vmr]
@@ -916,8 +925,12 @@ void MAMMicrophysics::run_impl(const double dt) {
916
925
}
917
926
}
918
927
// These output values need to be put somewhere:
919
- const auto aqso4_flx_col = ekat::subview (aqso4_flx, icol); // deposition flux of so4 [mole/mole/s]
920
- const auto aqh2so4_flx_col = ekat::subview (aqh2so4_flx, icol); // deposition flux of h2so4 [mole/mole/s]
928
+ mam4::MicrophysDiagnosticArrays diagnostic_arrays;
929
+ if (extra_mam4_diags_) {
930
+ // deposition flux of so4 [kg/m2/s] and deposition flux of h2so4 [kg/m2/s]
931
+ diagnostic_arrays.aqso4_column_integrated_flux = ekat::subview (aqso4_flx, icol);
932
+ diagnostic_arrays.aqh2so4_column_integrated_flux = ekat::subview (aqh2so4_flx, icol);
933
+ }
921
934
Real dflx_col[gas_pcnst] = {}; // deposition velocity [1/cm/s]
922
935
Real dvel_col[gas_pcnst] = {}; // deposition flux [1/cm^2/s]
923
936
// Output: values are dvel, dflx
@@ -937,7 +950,7 @@ void MAMMicrophysics::run_impl(const double dt) {
937
950
offset_aerosol, config.linoz .o3_sfc , config.linoz .o3_tau ,
938
951
config.linoz .o3_lbl , dry_diameter_icol, wet_diameter_icol,
939
952
wetdens_icol, dry_atm.phis (icol), cmfdqr, prain_icol, nevapr_icol,
940
- work_set_het_icol, drydep_data, aqso4_flx_col, aqh2so4_flx_col , dvel_col, dflx_col, progs);
953
+ work_set_het_icol, drydep_data, diagnostic_arrays , dvel_col, dflx_col, progs);
941
954
942
955
team.team_barrier ();
943
956
// Update constituent fluxes with gas drydep fluxes (dflx)
0 commit comments