Skip to content

Commit

Permalink
Implement call to mam4xx::perform_atmospheric_chemistry_and_microphys…
Browse files Browse the repository at this point in the history
…ics.
  • Loading branch information
overfelt committed Nov 17, 2024
1 parent 98ac5d3 commit ab69a0c
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ class MAMMicrophysics final : public scream::AtmosphereProcess {
// Constructor
MAMMicrophysics(const ekat::Comm &comm, const ekat::ParameterList &params);

// Virtual Destructor
virtual ~MAMMicrophysics() {}

// --------------------------------------------------------------------------
// AtmosphereProcess overrides (see share/atm_process/atmosphere_process.hpp)
// --------------------------------------------------------------------------
Expand All @@ -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(
Expand All @@ -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
Expand Down

0 comments on commit ab69a0c

Please sign in to comment.