@@ -146,6 +146,15 @@ void MAMMicrophysics::set_grids(
146
146
// surface albedo shortwave, direct
147
147
add_field<Required>(" sfc_alb_dir_vis" , scalar2d, nondim, grid_name);
148
148
149
+ // ----------- Variables from microphysics scheme -------------
150
+
151
+ // Evaporation from stratiform rain [kg/kg/s]
152
+ add_field<Required>(" nevapr" , scalar3d_mid, kg / kg / s, grid_name);
153
+
154
+ // Stratiform rain production rate [kg/kg/s]
155
+ add_field<Required>(" precip_total_tend" , scalar3d_mid, kg / kg / s,
156
+ grid_name);
157
+
149
158
// ---------------------------------------------------------------------
150
159
// These variables are "updated" or inputs/outputs for the process
151
160
// ---------------------------------------------------------------------
@@ -512,6 +521,9 @@ void MAMMicrophysics::initialize_impl(const RunType run_type) {
512
521
513
522
const int photo_table_len = get_photo_table_work_len (photo_table_);
514
523
work_photo_table_ = view_2d (" work_photo_table" , ncol_, photo_table_len);
524
+ const int sethet_work_len = mam4::mo_sethet::get_total_work_len_sethet ();
525
+ work_set_het_ = view_2d (" work_set_het_array" , ncol_, sethet_work_len);
526
+ cmfdqr_ = view_1d (" cmfdqr_" , nlev_);
515
527
516
528
// here's where we store per-column photolysis rates
517
529
photo_rates_ = view_3d (" photo_rates" , ncol_, nlev_, mam4::mo_photo::phtcnt);
@@ -565,6 +577,14 @@ void MAMMicrophysics::run_impl(const double dt) {
565
577
Kokkos::parallel_for (" preprocess" , scan_policy, preprocess_);
566
578
Kokkos::fence ();
567
579
580
+ // ----------- Variables from microphysics scheme -------------
581
+
582
+ // Evaporation from stratiform rain [kg/kg/s]
583
+ const auto & nevapr = get_field_in (" nevapr" ).get_view <const Real **>();
584
+
585
+ // Stratiform rain production rate [kg/kg/s]
586
+ const auto & prain = get_field_in (" precip_total_tend" ).get_view <const Real **>();
587
+
568
588
const auto wet_geometric_mean_diameter_i =
569
589
get_field_in (" dgnumwet" ).get_view <const Real ***>();
570
590
const auto dry_geometric_mean_diameter_i =
@@ -733,6 +753,8 @@ void MAMMicrophysics::run_impl(const double dt) {
733
753
clsmap_4[i] = mam4::gas_chemistry::clsmap_4[i];
734
754
permute_4[i] = mam4::gas_chemistry::permute_4[i];
735
755
}
756
+ const auto & cmfdqr = cmfdqr_;
757
+ const auto & work_set_het =work_set_het_;
736
758
// loop over atmosphere columns and compute aerosol microphyscs
737
759
Kokkos::parallel_for (
738
760
policy, KOKKOS_LAMBDA (const ThreadTeam &team) {
@@ -798,6 +820,9 @@ void MAMMicrophysics::run_impl(const double dt) {
798
820
ekat::subview (linoz_dPmL_dO3col, icol);
799
821
const auto linoz_cariolle_pscs_icol =
800
822
ekat::subview (linoz_cariolle_pscs, icol);
823
+ const auto nevapr_icol = ekat::subview (nevapr, icol);
824
+ const auto prain_icol = ekat::subview (prain, icol);
825
+ const auto work_set_het_icol = ekat::subview (work_set_het, icol);
801
826
// Note: All variables are inputs, except for progs, which is an
802
827
// input/output variable.
803
828
mam4::microphysics::perform_atmospheric_chemistry_and_microphysics (
@@ -811,7 +836,12 @@ void MAMMicrophysics::run_impl(const double dt) {
811
836
linoz_cariolle_pscs_icol, eccf, adv_mass_kg_per_moles, clsmap_4,
812
837
permute_4, offset_aerosol,
813
838
config.linoz .o3_sfc , config.linoz .o3_tau , config.linoz .o3_lbl ,
814
- dry_diameter_icol, wet_diameter_icol, wetdens_icol);
839
+ dry_diameter_icol, wet_diameter_icol, wetdens_icol,
840
+ dry_atm.phis (icol),
841
+ cmfdqr,
842
+ prain_icol,
843
+ nevapr_icol,
844
+ work_set_het_icol);
815
845
}); // parallel_for for the column loop
816
846
Kokkos::fence ();
817
847
0 commit comments