Skip to content

Commit 4f961ef

Browse files
Adds static compile time error checking
1 parent 9acaab9 commit 4f961ef

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,16 +172,15 @@ void MAMGenericInterface::add_tracers_gases() {
172172
//{"O3", "H2O2", "H2SO4", "SO2", "DMS", "SOAG"}
173173
using namespace ekat::units;
174174
constexpr auto q_unit = kg / kg; // units of mass mixing ratios of tracers
175-
176175
const auto &grid_name = grid_->name();
177176

178177
//Layout for 3D scalar fields at midpoints(col, level))
179178
const FieldLayout scalar3d_mid = grid_->get_3d_scalar_layout(true);
180179

181-
182-
//Special treatmenet for Ozone (O3):
183180
// O3 can be prescribed or prognostic depending upon the user input
184-
constexpr int o3_id = 0; //Index of Ozone in the gas list
181+
//Index of Ozone in the gas list (currently order of species is fixed)
182+
constexpr int o3_id = 0;
183+
static_assert(mam_coupling::gas_mmr_name[o3_id] == "O3", "The first gas must be O3");
185184
if (use_prescribed_ozone_) {
186185
// If using prescribed O3, we add it as a field
187186
add_field<Updated>(std::string(mam_coupling::gas_mmr_name[o3_id]), scalar3d_mid, q_unit, grid_name);

0 commit comments

Comments
 (0)