Skip to content

Commit 5a8a484

Browse files
committed
EAMxx: Fixing failing tests.
1 parent 6d8919a commit 5a8a484

File tree

1 file changed

+20
-26
lines changed

1 file changed

+20
-26
lines changed

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

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,9 @@ void MAMMicrophysics::set_grids(
245245
"o3_clim", "o3col_clim", "t_clim", "PmL_clim",
246246
"dPmL_dO3", "dPmL_dT", "dPmL_dO3col", "cariolle_pscs"};
247247
}
248+
// NOTE: order matches mam4xx:
249+
// names of variables in oxid file.
250+
var_names_oxi_={"O3", "OH", "NO3", "HO2"};
248251
#ifdef USE_OLD_LINOZ_FILE_READ
249252
if (config_.linoz.compute) {
250253

@@ -272,9 +275,6 @@ void MAMMicrophysics::set_grids(
272275
linoz_data_.init(num_cols_io_linoz, num_levs_io_linoz, nvars);
273276
linoz_data_.allocate_temporary_views();
274277
} // LINOZ reader
275-
// NOTE: order matches mam4xx:
276-
// names of variables in oxid file.
277-
var_names_oxi_={"O3", "OH", "NO3", "HO2"};
278278
{
279279
oxid_file_name_ = m_params.get<std::string>("mam4_oxid_file_name");
280280
const std::string oxid_map_file =
@@ -537,7 +537,7 @@ void MAMMicrophysics::set_oxid_reader()
537537
VerticalRemapperMAM4::VertRemapType::MAM4_PSRef);
538538
remap_data_oxid.custom_remapper=vertical_remapper;
539539
}
540-
data_interp_oxid_->create_vert_remapper (remap_data);
540+
data_interp_oxid_->create_vert_remapper (remap_data_oxid);
541541
data_interp_oxid_->init_data_interval (start_of_step_ts());
542542
}
543543
// set DataInterpolation object for linoz reader.
@@ -730,25 +730,9 @@ void MAMMicrophysics::initialize_impl(const RunType run_type) {
730730
add_postcondition_check<Interval>(get_field_out("cldfrac_liq"),m_grid,0.0,1.0,false);
731731
add_postcondition_check<LowerBound>(get_field_out("tke"),m_grid,0);
732732
*/
733-
#ifdef USE_OLD_LINOZ_FILE_READ
734-
if (config_.linoz.compute) {
735-
// climatology data for linear stratospheric chemistry
736-
auto linoz_o3_clim = buffer_.scratch[0]; // ozone (climatology) [vmr]
737-
auto linoz_o3col_clim =
738-
buffer_.scratch[1]; // column o3 above box (climatology) [Dobson Units
739-
// (DU)]
740-
auto linoz_t_clim = buffer_.scratch[2]; // temperature (climatology) [K]
741-
auto linoz_PmL_clim =
742-
buffer_.scratch[3]; // P minus L (climatology) [vmr/s]
743-
auto linoz_dPmL_dO3 =
744-
buffer_.scratch[4]; // sensitivity of P minus L to O3 [1/s]
745-
auto linoz_dPmL_dT =
746-
buffer_.scratch[5]; // sensitivity of P minus L to T3 [K]
747-
auto linoz_dPmL_dO3col = buffer_.scratch[6]; // sensitivity of P minus L to
748-
// overhead O3 column [vmr/DU]
749-
auto linoz_cariolle_pscs =
750-
buffer_.scratch[7]; // Cariolle parameter for PSC loss of ozone [1/s]
751733

734+
if (config_.linoz.compute) {
735+
// // climatology data for linear stratospheric chemistry
752736
auto ts = start_of_step_ts();
753737
std::string linoz_chlorine_file =
754738
m_params.get<std::string>("mam4_linoz_chlorine_file");
@@ -757,7 +741,6 @@ void MAMMicrophysics::initialize_impl(const RunType run_type) {
757741
linoz_chlorine_file, ts, chlorine_loading_ymd, chlorine_values_,
758742
chlorine_time_secs_);
759743
}
760-
#endif
761744
init_temporary_views();
762745
// FIXME : why are we only using nlev_ instead of ncol_xnlev?
763746
cmfdqr_ = view_1d("cmfdqr_", nlev_);
@@ -911,9 +894,6 @@ void MAMMicrophysics::run_impl(const double dt) {
911894
gas_aero_exchange_renaming_cloud_borne = get_field_out("mam4_microphysics_tendency_renaming_cloud_borne").get_view<Real***>();
912895
}
913896

914-
915-
916-
#ifdef USE_OLD_LINOZ_FILE_READ
917897
// climatology data for linear stratospheric chemistry
918898
// ozone (climatology) [vmr]
919899
view_2d linoz_o3_clim;
@@ -931,6 +911,20 @@ void MAMMicrophysics::run_impl(const double dt) {
931911
view_2d linoz_dPmL_dO3col;
932912
// Cariolle parameter for PSC loss of ozone [1/s]
933913
view_2d linoz_cariolle_pscs;
914+
915+
#ifdef USE_OLD_LINOZ_FILE_READ
916+
917+
linoz_o3_clim = buffer_.scratch[0]; // ozone (climatology) [vmr]
918+
linoz_o3col_clim = buffer_.scratch[1]; // column o3 above box (climatology) [Dobson Units
919+
// // (DU)]
920+
linoz_t_clim = buffer_.scratch[2]; // temperature (climatology) [K]
921+
linoz_PmL_clim = buffer_.scratch[3]; // P minus L (climatology) [vmr/s]
922+
linoz_dPmL_dO3 = buffer_.scratch[4]; // sensitivity of P minus L to O3 [1/s]
923+
linoz_dPmL_dT = buffer_.scratch[5]; // sensitivity of P minus L to T3 [K]
924+
linoz_dPmL_dO3col = buffer_.scratch[6]; // sensitivity of P minus L to
925+
// // overhead O3 column [vmr/DU]
926+
linoz_cariolle_pscs = buffer_.scratch[7]; // Cariolle parameter for PSC loss of ozone [1/s]
927+
934928
#else
935929
data_interp_oxid_->run(end_of_step_ts());
936930

0 commit comments

Comments
 (0)