From ab69a0c280c0ae8819a387e57aa8bc72cfa132fd Mon Sep 17 00:00:00 2001 From: James Overfelt Date: Sun, 17 Nov 2024 09:59:44 -0700 Subject: [PATCH] Implement call to mam4xx::perform_atmospheric_chemistry_and_microphysics. --- ...mxx_mam_microphysics_process_interface.cpp | 39 ++++++++++++++++--- ...mxx_mam_microphysics_process_interface.hpp | 7 +++- externals/mam4xx | 2 +- 3 files changed, 40 insertions(+), 8 deletions(-) diff --git a/components/eamxx/src/physics/mam/eamxx_mam_microphysics_process_interface.cpp b/components/eamxx/src/physics/mam/eamxx_mam_microphysics_process_interface.cpp index b0ab232c255c..f2b9438c7713 100644 --- a/components/eamxx/src/physics/mam/eamxx_mam_microphysics_process_interface.cpp +++ b/components/eamxx/src/physics/mam/eamxx_mam_microphysics_process_interface.cpp @@ -722,6 +722,7 @@ void MAMMicrophysics::run_impl(const double dt) { clsmap_4[i] = mam4::gas_chemistry::clsmap_4[i]; permute_4[i] = mam4::gas_chemistry::permute_4[i]; } + const mam4::seq_drydep::Data drydep_data = mam4::seq_drydep::set_gas_drydep_data(); // loop over atmosphere columns and compute aerosol microphyscs Kokkos::parallel_for( policy, KOKKOS_LAMBDA(const ThreadTeam &team) { @@ -787,20 +788,48 @@ void MAMMicrophysics::run_impl(const double dt) { ekat::subview(linoz_dPmL_dO3col, icol); const auto linoz_cariolle_pscs_icol = ekat::subview(linoz_cariolle_pscs, icol); - // Note: All variables are inputs, except for progs, which is an - // input/output variable. + + // All of these need to be filled with valid data: + const int month = 0; + const Real sfc_temp = 0; + const Real air_temp = 0; + const Real tv = 0; + const Real pressure_sfc = 0; + const Real pressure_10m = 0; + const Real spec_hum = 0; + const Real wind_speed = 0; + const Real rain = 0; + const Real snow = 0; + const Real solar_flux = 0; + const Real mmr[gas_pcnst] = {}; + const Real fraction_landuse[mam4::mo_drydep::n_land_type] = {}; + const int col_index_season[mam4::mo_drydep::n_land_type] = {}; + // These output values need to be put somewhere: + Real dvel[gas_pcnst] = {}; + Real dflx[gas_pcnst] = {}; + + // Output: values are dvel, dvlx + // Input/Output: progs::stateq, progs::qqcw mam4::microphysics::perform_atmospheric_chemistry_and_microphysics( - team, dt, rlats, cnst_offline_icol, forcings_in, atm, progs, + team, dt, rlats, month, + sfc_temp, air_temp, tv, + pressure_sfc, pressure_10m, spec_hum, + wind_speed, rain, snow, + solar_flux, + cnst_offline_icol, forcings_in, atm, photo_table, chlorine_loading, config.setsox, config.amicphys, config.linoz.psc_T, zenith_angle(icol), d_sfc_alb_dir_vis(icol), o3_col_dens_i, photo_rates_icol, extfrc_icol, invariants_icol, work_photo_table_icol, linoz_o3_clim_icol, linoz_t_clim_icol, linoz_o3col_clim_icol, linoz_PmL_clim_icol, linoz_dPmL_dO3_icol, linoz_dPmL_dT_icol, linoz_dPmL_dO3col_icol, - linoz_cariolle_pscs_icol, eccf, adv_mass_kg_per_moles, clsmap_4, + linoz_cariolle_pscs_icol, eccf, adv_mass_kg_per_moles, + mmr, fraction_landuse, col_index_season, clsmap_4, permute_4, offset_aerosol, config.linoz.o3_sfc, config.linoz.o3_tau, config.linoz.o3_lbl, - dry_diameter_icol, wet_diameter_icol, wetdens_icol); + dry_diameter_icol, wet_diameter_icol, wetdens_icol, + drydep_data, + dvel, dflx, progs); }); // parallel_for for the column loop Kokkos::fence(); diff --git a/components/eamxx/src/physics/mam/eamxx_mam_microphysics_process_interface.hpp b/components/eamxx/src/physics/mam/eamxx_mam_microphysics_process_interface.hpp index 6b1dd33dfaa2..8144ccc1a5df 100644 --- a/components/eamxx/src/physics/mam/eamxx_mam_microphysics_process_interface.hpp +++ b/components/eamxx/src/physics/mam/eamxx_mam_microphysics_process_interface.hpp @@ -32,6 +32,9 @@ class MAMMicrophysics final : public scream::AtmosphereProcess { // Constructor MAMMicrophysics(const ekat::Comm &comm, const ekat::ParameterList ¶ms); + // Virtual Destructor + virtual ~MAMMicrophysics() {} + // -------------------------------------------------------------------------- // AtmosphereProcess overrides (see share/atm_process/atmosphere_process.hpp) // -------------------------------------------------------------------------- @@ -40,7 +43,7 @@ class MAMMicrophysics final : public scream::AtmosphereProcess { AtmosphereProcessType type() const override; // The name of the subcomponent - std::string name() const { return "mam_aero_microphysics"; } + std::string name() const override { return "mam_aero_microphysics"; } // grid void set_grids( @@ -57,7 +60,7 @@ class MAMMicrophysics final : public scream::AtmosphereProcess { void run_impl(const double dt) override; // Finalize - void finalize_impl(){/*Do nothing*/}; + void finalize_impl() override {/*Do nothing*/}; private: // number of horizontal columns and vertical levels diff --git a/externals/mam4xx b/externals/mam4xx index aae46807bf58..c952d3626357 160000 --- a/externals/mam4xx +++ b/externals/mam4xx @@ -1 +1 @@ -Subproject commit aae46807bf58d6ffcbc6db620c27568450b2d040 +Subproject commit c952d3626357cfc3b1e9f6ef9d2848f966ace40c