Skip to content

Commit 3393b59

Browse files
committed
add metadata strings to diag fields and units
1 parent f6c67bd commit 3393b59

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

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

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,17 @@ void MAMMicrophysics::set_grids(
219219
// Diagnostics: H2SO4 in-cloud tendencies[kg/kg/s]
220220
add_field<Computed>("mam4_microphysics_tendency_aqh2so4", vector3d_mid_nmodes, kg / kg / s, grid_name);
221221

222-
add_field<Computed>("mam4_microphys_tendency_condensation", vector3d_num_gas_aerosol_constituents, pow(mol, -1), grid_name);
223-
add_field<Computed>("mam4_microphys_tendency_renaming", vector3d_num_gas_aerosol_constituents, pow(mol, -1), grid_name);
224-
add_field<Computed>("mam4_microphys_tendency_nucleation", vector3d_num_gas_aerosol_constituents, pow(mol, -1), grid_name);
225-
add_field<Computed>("mam4_microphys_tendency_coagulation", vector3d_num_gas_aerosol_constituents, pow(mol, -1), grid_name);
226-
add_field<Computed>("mam4_microphys_tendency_renaming_cloud_borne", vector3d_num_gas_aerosol_constituents, pow(mol, -1), grid_name);
222+
// constexpr ekat::units::Units u_heterogeneous = ekat::units::Units(ekat::units::Units::nondimensional(), "Warning: This array carries quantities with heterogeneous units");
223+
add_field<Computed>("mam4_microphys_tendency_condensation", vector3d_num_gas_aerosol_constituents, pow(mol, -1), grid_name);
224+
add_field<Computed>("mam4_microphys_tendency_renaming", vector3d_num_gas_aerosol_constituents, pow(mol, -1), grid_name);
225+
add_field<Computed>("mam4_microphys_tendency_nucleation", vector3d_num_gas_aerosol_constituents, pow(mol, -1), grid_name);
226+
add_field<Computed>("mam4_microphys_tendency_coagulation", vector3d_num_gas_aerosol_constituents, pow(mol, -1), grid_name);
227+
add_field<Computed>("mam4_microphys_tendency_renaming_cloud_borne", vector3d_num_gas_aerosol_constituents, pow(mol, -1), grid_name);
228+
// get_field_set_io_docstring("mam4_microphys_tendency_condensation");
229+
// get_field_set_io_docstring("mam4_microphys_tendency_renaming");
230+
// get_field_set_io_docstring("mam4_microphys_tendency_nucleation");
231+
// get_field_set_io_docstring("mam4_microphys_tendency_coagulation");
232+
// get_field_set_io_docstring("mam4_microphys_tendency_renaming_cloud_borne");
227233
}
228234

229235
// Creating a Linoz reader and setting Linoz parameters involves reading data

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,13 @@ class MAMMicrophysics final : public MAMGenericInterface {
163163
void init_temporary_views();
164164
int len_temporary_views_{0};
165165

166+
void get_field_set_io_docstring(const std::string &fname) {
167+
using str_atts_t = std::map<std::string,std::string>;
168+
auto &f = get_field_out(fname);
169+
auto &io_str_atts = f.get_header().get_extra_data<str_atts_t>("io: string attributes");
170+
io_str_atts["doc"] = "Collection of heterogeneous quantities--species have different units";
171+
}
172+
166173
}; // MAMMicrophysics
167174

168175
} // namespace scream

0 commit comments

Comments
 (0)