diff --git a/components/eamxx/src/physics/mam/eamxx_mam_wetscav_process_interface.cpp b/components/eamxx/src/physics/mam/eamxx_mam_wetscav_process_interface.cpp index 2a81c1a9c42..81f13fd6ae9 100644 --- a/components/eamxx/src/physics/mam/eamxx_mam_wetscav_process_interface.cpp +++ b/components/eamxx/src/physics/mam/eamxx_mam_wetscav_process_interface.cpp @@ -47,10 +47,6 @@ void MAMWetscav::set_grids( // layout for 2D (1d horiz X 1d vertical) variables FieldLayout scalar2d = m_grid->get_2d_scalar_layout(); - // layout for 3D (ncol, nmodes, nlevs) - FieldLayout scalar3d_mid_nmodes = - m_grid->get_3d_vector_layout(true, nmodes, "nmodes"); - // layout for 2D (ncol, pcnst) FieldLayout scalar2d_pconst = m_grid->get_2d_vector_layout(pcnst, "num_phys_constants"); @@ -205,22 +201,6 @@ void MAMWetscav::set_grids( // ------------------------------------------------------------- // These variables are "Computed" or outputs for the process // ------------------------------------------------------------- - static constexpr auto m3 = m * m * m; - - // Aerosol dry particle diameter [m] - add_field("dgncur_a", scalar3d_mid_nmodes, m, grid_name); - - // Wet aerosol density [kg/m3] - add_field("wetdens", scalar3d_mid_nmodes, kg / m3, grid_name); - - // Aerosol water [kg/kg] - add_field("qaerwat", scalar3d_mid_nmodes, kg / kg, grid_name); - - // Wet aerosol diameter [m] - add_field("dgnumwet", scalar3d_mid_nmodes, m, grid_name); - - // Fraction of transported species that are insoluble [fraction] - add_field("fracis", scalar3d_mid, nondim, grid_name); // Aerosol wet deposition (interstitial) [kg/m2/s] add_field("aerdepwetis", scalar2d_pconst, kg / m2 / s, grid_name); @@ -352,6 +332,14 @@ void MAMWetscav::initialize_impl(const RunType run_type) { } } + const int nmodes = mam4::AeroConfig::num_modes(); + + // Aerosol dry particle diameter [m] + dgncur_a_ = view_3d("dgncur_a", ncol_, nmodes, nlev_); + wetdens_ = view_3d("wetdens", ncol_, nmodes, nlev_); + qaerwat_ = view_3d("qaerwat", ncol_, nmodes, nlev_); + dgnumwet_ = view_3d("dgnumwet", ncol_, nmodes, nlev_); + // Allocate work array const int work_len = mam4::wetdep::get_aero_model_wetdep_work_len(); work_ = view_2d("work", ncol_, work_len); @@ -475,12 +463,10 @@ void MAMWetscav::run_impl(const double dt) { const auto aerdepwetis = get_field_out("aerdepwetis").get_view(); const auto aerdepwetcw = get_field_out("aerdepwetcw").get_view(); - const auto wet_geometric_mean_diameter_i = - get_field_out("dgnumwet").get_view(); - const auto dry_geometric_mean_diameter_i = - get_field_out("dgncur_a").get_view(); - const auto qaerwat = get_field_out("qaerwat").get_view(); - const auto wetdens = get_field_out("wetdens").get_view(); + const auto wet_geometric_mean_diameter_i = dgnumwet_; + const auto dry_geometric_mean_diameter_i = dgncur_a_; + const auto qaerwat = qaerwat_; + const auto wetdens = wetdens_; const auto policy = ekat::ExeSpaceUtils::get_default_team_policy(ncol_, nlev_); diff --git a/components/eamxx/src/physics/mam/eamxx_mam_wetscav_process_interface.hpp b/components/eamxx/src/physics/mam/eamxx_mam_wetscav_process_interface.hpp index 9d1dc20bc88..3c3dec6cc62 100644 --- a/components/eamxx/src/physics/mam/eamxx_mam_wetscav_process_interface.hpp +++ b/components/eamxx/src/physics/mam/eamxx_mam_wetscav_process_interface.hpp @@ -23,6 +23,7 @@ namespace scream { class MAMWetscav : public scream::AtmosphereProcess { using KT = ekat::KokkosTypes; using view_2d = typename KT::template view_2d; + using view_3d = typename KT::template view_3d; // a thread team dispatched to a single vertical column using ThreadTeam = mam4::ThreadTeam; @@ -160,9 +161,18 @@ class MAMWetscav : public scream::AtmosphereProcess { // Work arrays view_2d work_; + // Aerosol dry particle diameter [m] + // Dimensions: [cols, modes, levels] + view_3d dgncur_a_; + // Wet aerosol density [kg/m3] + view_3d wetdens_; + // Aerosol water [kg/kg] + view_3d qaerwat_; + // Wet aerosol diameter [m] + view_3d dgnumwet_; + // TODO: Following variables are from convective parameterization (not // implemented yet in EAMxx), so should be zero for now - view_2d sh_frac_; // Deep convective cloud fraction [fraction] diff --git a/components/eamxx/tests/multi-process/physics_only/mam/p3_mam4_wetscav/output.yaml b/components/eamxx/tests/multi-process/physics_only/mam/p3_mam4_wetscav/output.yaml index c26db8eb681..049dcdad35a 100644 --- a/components/eamxx/tests/multi-process/physics_only/mam/p3_mam4_wetscav/output.yaml +++ b/components/eamxx/tests/multi-process/physics_only/mam/p3_mam4_wetscav/output.yaml @@ -56,10 +56,6 @@ Field Names: - num_c4 - aerdepwetis - aerdepwetcw - - dgnumwet - - dgncur_a - - wetdens - - qaerwat output_control: Frequency: ${NUM_STEPS} frequency_units: nsteps diff --git a/components/eamxx/tests/multi-process/physics_only/mam/shoc_cldfrac_p3_wetscav/output.yaml b/components/eamxx/tests/multi-process/physics_only/mam/shoc_cldfrac_p3_wetscav/output.yaml index 1ae53e6c1c3..c38bafaa65e 100644 --- a/components/eamxx/tests/multi-process/physics_only/mam/shoc_cldfrac_p3_wetscav/output.yaml +++ b/components/eamxx/tests/multi-process/physics_only/mam/shoc_cldfrac_p3_wetscav/output.yaml @@ -90,10 +90,6 @@ Field Names: - num_c4 - aerdepwetis - aerdepwetcw - - dgnumwet - - dgncur_a - - wetdens - - qaerwat output_control: Frequency: ${NUM_STEPS} frequency_units: nsteps diff --git a/components/eamxx/tests/single-process/mam/wet_scav/output.yaml b/components/eamxx/tests/single-process/mam/wet_scav/output.yaml index 9cd0a16bc41..75172823870 100644 --- a/components/eamxx/tests/single-process/mam/wet_scav/output.yaml +++ b/components/eamxx/tests/single-process/mam/wet_scav/output.yaml @@ -7,10 +7,6 @@ Fields: Field Names: - aerdepwetis - aerdepwetcw - - dgnumwet - - dgncur_a - - wetdens - - qaerwat - bc_c1 - bc_c3 - bc_c4