Skip to content

Commit f7a7ad6

Browse files
authored
Merge pull request #3120 from eagles-project/oscar/sethet_interface
EAMxx: Modify microphysics interface to include sethet (washout rates)
2 parents 0af3b66 + af3343b commit f7a7ad6

File tree

5 files changed

+93
-3
lines changed

5 files changed

+93
-3
lines changed

components/eamxx/src/physics/mam/eamxx_mam_microphysics_process_interface.cpp

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,15 @@ void MAMMicrophysics::set_grids(
146146
// surface albedo shortwave, direct
147147
add_field<Required>("sfc_alb_dir_vis", scalar2d, nondim, grid_name);
148148

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+
149158
// ---------------------------------------------------------------------
150159
// These variables are "updated" or inputs/outputs for the process
151160
// ---------------------------------------------------------------------
@@ -512,6 +521,9 @@ void MAMMicrophysics::initialize_impl(const RunType run_type) {
512521

513522
const int photo_table_len = get_photo_table_work_len(photo_table_);
514523
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_);
515527

516528
// here's where we store per-column photolysis rates
517529
photo_rates_ = view_3d("photo_rates", ncol_, nlev_, mam4::mo_photo::phtcnt);
@@ -565,6 +577,14 @@ void MAMMicrophysics::run_impl(const double dt) {
565577
Kokkos::parallel_for("preprocess", scan_policy, preprocess_);
566578
Kokkos::fence();
567579

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+
568588
const auto wet_geometric_mean_diameter_i =
569589
get_field_in("dgnumwet").get_view<const Real ***>();
570590
const auto dry_geometric_mean_diameter_i =
@@ -733,6 +753,8 @@ void MAMMicrophysics::run_impl(const double dt) {
733753
clsmap_4[i] = mam4::gas_chemistry::clsmap_4[i];
734754
permute_4[i] = mam4::gas_chemistry::permute_4[i];
735755
}
756+
const auto& cmfdqr = cmfdqr_;
757+
const auto& work_set_het =work_set_het_;
736758
// loop over atmosphere columns and compute aerosol microphyscs
737759
Kokkos::parallel_for(
738760
policy, KOKKOS_LAMBDA(const ThreadTeam &team) {
@@ -798,6 +820,9 @@ void MAMMicrophysics::run_impl(const double dt) {
798820
ekat::subview(linoz_dPmL_dO3col, icol);
799821
const auto linoz_cariolle_pscs_icol =
800822
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);
801826
// Note: All variables are inputs, except for progs, which is an
802827
// input/output variable.
803828
mam4::microphysics::perform_atmospheric_chemistry_and_microphysics(
@@ -811,7 +836,12 @@ void MAMMicrophysics::run_impl(const double dt) {
811836
linoz_cariolle_pscs_icol, eccf, adv_mass_kg_per_moles, clsmap_4,
812837
permute_4, offset_aerosol,
813838
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);
815845
}); // parallel_for for the column loop
816846
Kokkos::fence();
817847

components/eamxx/src/physics/mam/eamxx_mam_microphysics_process_interface.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,9 @@ class MAMMicrophysics final : public scream::AtmosphereProcess {
242242
view_1d acos_cosine_zenith_;
243243

244244
view_int_2d index_season_lai_;
245+
// // dq/dt for convection [kg/kg/s]
246+
view_1d cmfdqr_;
247+
view_2d work_set_het_;
245248

246249
}; // MAMMicrophysics
247250

components/eamxx/tests/single-process/mam/aero_microphys/input.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ initial_conditions:
5858
dgnum: [1.246662106183775E-007, 4.081134799487888E-008, 1.103139143795796E-006, 1.000000011686097E-007]
5959
dgnumwet: [2.367209731605067E-007, 6.780643470563889E-008, 3.028011448344027E-006, 1.000000096285154E-007]
6060
wetdens: [1038.67760516297, 1046.20002003441, 1031.74623165457, 1086.79731859184]
61-
61+
nevapr: 0.0
62+
precip_total_tend: 0.0
6263
# The parameters for I/O control
6364
Scorpio:
6465
output_yaml_files: ["output.yaml"]

components/eamxx/tests/single-process/mam/aero_microphys/output.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,62 @@ Fields:
66
Physics:
77
Field Names:
88
- T_mid
9+
- O3
10+
- H2O2
11+
- H2SO4
12+
- SO2
13+
- DMS
14+
- SOAG
15+
- bc_a1
16+
- bc_a3
17+
- bc_a4
18+
- dst_a1
19+
- dst_a3
20+
- so4_a1
21+
- so4_a2
22+
- so4_a3
23+
- pom_a1
24+
- pom_a3
25+
- pom_a4
26+
- soa_a1
27+
- soa_a2
28+
- soa_a3
29+
- nacl_a1
30+
- nacl_a2
31+
- nacl_a3
32+
- mom_a1
33+
- mom_a2
34+
- mom_a3
35+
- mom_a4
36+
- num_a1
37+
- num_a2
38+
- num_a3
39+
- num_a4
40+
- bc_c1
41+
- bc_c3
42+
- bc_c4
43+
- dst_c1
44+
- dst_c3
45+
- so4_c1
46+
- so4_c2
47+
- so4_c3
48+
- pom_c1
49+
- pom_c3
50+
- pom_c4
51+
- soa_c1
52+
- soa_c2
53+
- soa_c3
54+
- nacl_c1
55+
- nacl_c2
56+
- nacl_c3
57+
- mom_c1
58+
- mom_c2
59+
- mom_c3
60+
- mom_c4
61+
- num_c1
62+
- num_c2
63+
- num_c3
64+
- num_c4
965
# To save these fields make sure to turn on
1066
# OUTPUT_TRACER_FIELDS
1167
#- oxi_fields

0 commit comments

Comments
 (0)