ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
MamConstituents Class Reference

#include <ERF_Mam4Constitutents.H>

Collaboration diagram for MamConstituents:

Classes

struct  aerlist_t
 
struct  aerosol_t
 
struct  gas_t
 
struct  gaslist_t
 
struct  mode_component_t
 
struct  modelist_t
 
struct  modes_t
 

Public Member Functions

 MamConstituents ()
 
void rad_cnst_init ()
 
void init_mode_comps ()
 
void rad_cnst_get_gas (int list_idx, const std::string &gasname, real2d &mmr) const
 
void get_nmodes (int list_idx, int &nmodes) const
 
void get_ngas (int list_idx, int &ngas) const
 
void get_naero (int list_idx, int &naero) const
 
void get_gas_names (int list_idx, std::vector< std::string > &gasnames, bool &use_data_o3) const
 
void get_aero_names (int list_idx, std::vector< std::string > &aernames) const
 
void get_mode_nspec (int list_idx, int m_idx, int &nspec) const
 
void rad_cnst_get_info_by_mode (int list_idx, int m_idx, std::string &mode_type, std::string &num_name, std::string &num_name_cw, int &nspec) const
 
void rad_cnst_get_info_by_mode_spec (int list_idx, int m_idx, int s_idx, std::string &spec_type, std::string &spec_name, std::string &spec_name_cw) const
 
void rad_cnst_get_info_by_spectype (int list_idx, const std::string &spectype, int &mode_idx, int &spec_idx) const
 
int rad_cnst_get_mode_idx (int list_idx, const std::string &mode_type) const
 
int rad_cnst_get_spec_idx (int list_idx, int mode_idx, const std::string &spec_type) const
 
void rad_cnst_out (int list_idx) const
 
void rad_cnst_get_aer_mmr_by_idx (int list_idx, int aer_idx, real2d &mmr) const
 
void rad_cnst_get_mam_mmr_by_idx (int list_idx, int mode_idx, int spec_idx, const std::string &phase, real2d &mmr) const
 
void rad_cnst_get_mam_mmr_idx (int mode_idx, int spec_idx, int &idx) const
 
void rad_cnst_get_mode_num (int list_idx, int mode_idx, const std::string &phase, real2d &num) const
 
void rad_cnst_get_mode_num_idx (int mode_idx, int &cnst_idx) const
 
int rad_cnst_get_aer_idx (int list_idx, std::string &aer_name) const
 
void get_mode_props (int list_idx, int mode_idx, real &sigmag, real &rhcrystal, real &rhdeliques) const
 
void get_mode_props (int list_idx, int mode_idx, real &sigmag, real2d &refrtablw, real2d &refitablw, real4d &absplw) const
 
void get_mode_props (int list_idx, int mode_idx, real &sigmag, real2d &refrtabsw, real2d &refitabsw, real4d &extpsw, real4d &abspsw, real4d &asmpsw) const
 
void get_mode_props (int list_idx, int mode_idx, int &ncoef, int &prefr, int &prefi) const
 
void get_mode_props (int list_idx, int mode_idx, real &dgnum, real &dgnumhi, real &dgnumlo, real &sigmag) const
 
void get_mam_density_aer (int list_idx, int mode_idx, int spec_idx, real &density_aer) const
 
void get_mam_hygro_aer (int list_idx, int mode_idx, int spec_idx, real &hygro_aer) const
 
void get_mam_props (int list_idx, int mode_idx, int spec_idx, real &density_aer, std::string &spectype, real &hygro_aer, real1d &refindex_real_aer_sw, real1d &refindex_im_aer_sw) const
 
void get_mam_props_sw (int list_idx, int mode_idx, int spec_idx, real &density_aer, real1d &refindex_real_aer_sw, real1d &refindex_im_aer_sw) const
 
void get_mam_props (int list_idx, int mode_idx, int spec_idx, real &density_aer) const
 
void get_mam_props_lw (int list_idx, int mode_idx, int spec_idx, real &density_aer, real1d &refindex_real_aer_lw, real1d &refindex_im_aer_lw) const
 
void get_aer_opticstype (int list_idx, int aer_idx, std::string &opticstype) const
 
void get_aer_sw_hygro_ext (int list_idx, int aer_idx, real2d &sw_hygro_ext) const
 
void get_aer_sw_hygro_ssa (int list_idx, int aer_idx, real2d &sw_hygro_ssa) const
 
void get_aer_sw_hygro_asm (int list_idx, int aer_idx, real2d &sw_hygro_asm) const
 
void get_aer_lw_hygro_abs (int list_idx, int aer_idx, real2d &lw_hygro_abs) const
 
void get_aer_sw_nonhygro_ext (int list_idx, int aer_idx, real1d &sw_nonhygro_ext) const
 
void get_aer_sw_nonhygro_ssa (int list_idx, int aer_idx, real1d &sw_nonhygro_ssa) const
 
void get_aer_sw_nonhygro_asm (int list_idx, int aer_idx, real1d &sw_nonhygro_asm) const
 
void get_aer_sw_nonhygro_scat (int list_idx, int aer_idx, real1d &sw_nonhygro_scat) const
 
void get_aer_sw_nonhygro_ascat (int list_idx, int aer_idx, real1d &sw_nonhygro_ascat) const
 
void get_aer_lw_abs (int list_idx, int aer_idx, real1d &lw_abs) const
 
void get_aer_refindex_aer_sw (int list_idx, int aer_idx, real1d &refindex_real_aer_sw, real1d &refindex_im_aer_sw) const
 
void get_aer_refindex_aer_lw (int list_idx, int aer_idx, real1d &refindex_real_aer_lw, real1d &refindex_im_aer_lw) const
 
void get_aer_r_sw_ext (int list_idx, int aer_idx, real2d &r_sw_ext) const
 
void get_aer_r_sw_scat (int list_idx, int aer_idx, real2d &r_sw_scat) const
 
void get_aer_r_sw_ascat (int list_idx, int aer_idx, real2d &r_sw_ascat) const
 
void get_aer_r_lw_abs (int list_idx, int aer_idx, real2d &r_lw_abs) const
 
void get_aer_mu (int list_idx, int aer_idx, real1d &mu) const
 
void get_aername (int list_idx, int aer_idx, std::string &aername) const
 
void get_density_aer (int list_idx, int aer_idx, real &density_aer) const
 
void get_hygro_aer (int list_idx, int aer_idx, real &hygro_aer) const
 
void get_dryrad_aer (int list_idx, int aer_idx, real &dryrad_aer) const
 
void get_dispersion_aer (int list_idx, int aer_idx, real &dispersion_aer) const
 
void get_num_to_mass_aer (int list_idx, int aer_idx, real &num_to_mass_aer) const
 

Public Attributes

const int N_DIAG = 10
 
std::string iceopticsfile
 
std::string liqopticsfile
 
std::string icecldoptics
 
std::string liqcldoptics
 
const bool oldcldoptics = false
 
const int n_rad_cnst = 30
 
std::vector< gaslist_tgaslist
 
std::vector< aerlist_taerosollist
 
std::vector< modelist_tma_list
 
modes_t modes
 
PhysProp prop
 
const int num_mode_types = 8
 
const int num_spec_types = 8
 
const std::vector< std::string > mode_type_names
 
const std::vector< std::string > spec_type_names
 

Constructor & Destructor Documentation

◆ MamConstituents()

MamConstituents::MamConstituents ( )
inline
121  {
122  //
123  // NOTE:
124  // we hard-coded the use nmodes = 3, and nspeces = {6, 3, 3}
125  //
126  // allocate components that depend on nmodes
127  auto erf_rad_data_dir = getRadiationDataDir() + "/";
128 
129  // initialize yakl
130  if (!yakl::isInitialized()) yakl::init();
131 
132  int nmodes = 3;
133  std::vector<int> num_spec{6, 3, 3};
134 
135  modes.nmodes = 3;
136  modes.names.resize(nmodes);
137  modes.types.resize(nmodes);
138  modes.comps.resize(nmodes);
139 
140  modes.comps[0].nspec = num_spec[0];
141  modes.names[0] = "mam3_mode_0";
142  modes.types[0] = "accum";
143 
144  modes.comps[0].source_num_a = "N";
145  modes.comps[0].camname_num_a = "num_a1";
146  modes.comps[0].source_num_c = "N";
147  modes.comps[0].camname_num_c = "num_c1";
148 
149  modes.comps[0].type.resize(num_spec[0]);
150  modes.comps[0].type[0] = "sulfate";
151  modes.comps[0].type[1] = "p-organic";
152  modes.comps[0].type[2] = "s-organic";
153  modes.comps[0].type[3] = "black-c";
154  modes.comps[0].type[4] = "dust";
155  modes.comps[0].type[5] = "seasalt";
156 
157  modes.comps[0].props.resize(num_spec[0]);
158  modes.comps[0].idx_props.resize(num_spec[0]);
159  modes.comps[0].props[0] = erf_rad_data_dir + "sulfate_rrtmg_c080918.nc";
160  modes.comps[0].props[1] = erf_rad_data_dir + "ocpho_rrtmg_c101112.nc";
161  modes.comps[0].props[2] = erf_rad_data_dir + "ocphi_rrtmg_c100508.nc";
162  modes.comps[0].props[3] = erf_rad_data_dir + "bcpho_rrtmg_c100508.nc";
163  modes.comps[0].props[4] = erf_rad_data_dir + "dust_aeronet_rrtmg_c141106.nc";
164  modes.comps[0].props[5] = erf_rad_data_dir + "ssam_rrtmg_c100508.nc";
165 
166  modes.comps[1].nspec = num_spec[1];
167  modes.names[1] = "mam3_mode_1";
168  modes.types[1] = "aitken";
169 
170  modes.comps[1].source_num_a = "N";
171  modes.comps[1].camname_num_a = "num_a2";
172  modes.comps[1].source_num_c = "N";
173  modes.comps[1].camname_num_c = "num_c2";
174 
175  modes.comps[1].type.resize(num_spec[1]);
176  modes.comps[1].type[0] = "sulfate";
177  modes.comps[1].type[1] = "s-organic";
178  modes.comps[1].type[2] = "seasalt";
179 
180  modes.comps[1].props.resize(num_spec[1]);
181  modes.comps[1].idx_props.resize(num_spec[1]);
182  modes.comps[1].props[0] = erf_rad_data_dir + "sulfate_rrtmg_c080918.nc";
183  modes.comps[1].props[1] = erf_rad_data_dir + "ocphi_rrtmg_c100508.nc";
184  modes.comps[1].props[2] = erf_rad_data_dir + "ssam_rrtmg_c100508.nc";
185 
186  modes.comps[2].nspec = num_spec[2];
187  modes.names[2] = "mam3_mode_2";
188  modes.types[2] = "coarse";
189 
190  modes.comps[2].source_num_a = "N";
191  modes.comps[2].camname_num_a = "num_a3";
192  modes.comps[2].source_num_c = "N";
193  modes.comps[2].camname_num_c = "num_c3";
194 
195  modes.comps[2].type.resize(num_spec[2]);
196  modes.comps[2].type[0] = "dust";
197  modes.comps[2].type[1] = "seasalt";
198  modes.comps[2].type[2] = "sulfate";
199 
200  modes.comps[2].props.resize(num_spec[2]);
201  modes.comps[2].idx_props.resize(num_spec[2]);
202  modes.comps[2].props[0] = erf_rad_data_dir + "dust_aeronet_rrtmg_c141106.nc";
203  modes.comps[2].props[1] = erf_rad_data_dir + "ssam_rrtmg_c100508.nc";
204  modes.comps[2].props[2] = erf_rad_data_dir + "sulfate_rrtmg_c080918.nc";
205 
206  gaslist.resize(N_DIAG);
207  aerosollist.resize(N_DIAG);
208  ma_list.resize(N_DIAG);
209 
210  // Set the list_id fields which distinguish the climate and diagnostic lists
211  for(auto i = 0; i < N_DIAG; ++i) {
212  aerosollist[i].list_id = "";
213  gaslist[i].list_id = "";
214  ma_list[i].list_id = "";
215  }
216 
217  gaslist[0].ngas = 8;
218  gaslist[0].gas.resize(gaslist[0].ngas);
219  gaslist[0].gas[0].source = "A";
220  gaslist[0].gas[1].source = "N";
221  gaslist[0].gas[2].source = "N";
222  gaslist[0].gas[3].source = "N";
223  gaslist[0].gas[4].source = "N";
224  gaslist[0].gas[5].source = "N";
225  gaslist[0].gas[6].source = "N";
226  gaslist[0].gas[7].source = "N";
227 
228  gaslist[0].gas[0].camname = "Q";
229  gaslist[0].gas[1].camname = "O3";
230  gaslist[0].gas[2].camname = "O2";
231  gaslist[0].gas[3].camname = "CO2";
232  gaslist[0].gas[4].camname = "N2O";
233  gaslist[0].gas[5].camname = "CH4";
234  gaslist[0].gas[6].camname = "CFC11";
235  gaslist[0].gas[7].camname = "CFC12";
236 
237  ma_list[0].nmodes = 3;
238  ma_list[0].idx.resize(ma_list[0].nmodes);
239  ma_list[0].idx[0] = 0;
240  ma_list[0].idx[1] = 1;
241  ma_list[0].idx[2] = 2;
242 
243  ma_list[0].physprop_files.resize(ma_list[0].nmodes);
244  ma_list[0].idx_props.resize(ma_list[0].nmodes);
245 
246  ma_list[0].physprop_files.resize(ma_list[0].nmodes);
247  ma_list[0].physprop_files[0] = erf_rad_data_dir + "mam3_mode1_rrtmg_c110318.nc";
248  ma_list[0].physprop_files[1] = erf_rad_data_dir + "mam3_mode2_rrtmg_c110318.nc";
249  ma_list[0].physprop_files[2] = erf_rad_data_dir + "mam3_mode3_rrtmg_c110318.nc";
250 
251  ma_list[0].idx_props.resize(ma_list[0].nmodes);
252  ma_list[0].idx_props[0] = 78384393;
253  ma_list[0].idx_props[1] = 8192;
254  ma_list[0].idx_props[2] = 78384392;
255 
256  // Start with the bulk aerosol species in the climate/diagnostic lists.
257  // The physprop_accum_unique_files routine has the side effect of returning the number
258  // of bulk aerosols in each list (they're identified by type='A').
259  for(auto i = 0; i < ma_list[0].nmodes; ++i)
260  prop.physprop_accum_unique_files(ma_list[0].physprop_files[i], "A");
261 
262  // Add physprop files for the species from the mode definitions.
263  for(auto i = 0; i < modes.nmodes; ++i) {
264  for(auto j = 0; j < modes.comps[i].nspec; ++j)
265  prop.physprop_accum_unique_files(modes.comps[i].props[j], "M");
266  }
267 
268  // initialize the gas and aerosol lists
269  rad_cnst_init();
270  }
const int N_DIAG
Definition: ERF_Mam4Constitutents.H:20
modes_t modes
Definition: ERF_Mam4Constitutents.H:106
void rad_cnst_init()
Definition: ERF_Mam4Constitutents.H:278
std::vector< modelist_t > ma_list
Definition: ERF_Mam4Constitutents.H:103
std::vector< gaslist_t > gaslist
Definition: ERF_Mam4Constitutents.H:97
std::vector< aerlist_t > aerosollist
Definition: ERF_Mam4Constitutents.H:100
PhysProp prop
Definition: ERF_Mam4Constitutents.H:109
void physprop_accum_unique_files(const std::string &filename, const std::string &type)
Definition: ERF_PhysProp.H:92
std::vector< mode_component_t > comps
Definition: ERF_Mam4Constitutents.H:54
int nmodes
Definition: ERF_Mam4Constitutents.H:51
std::vector< std::string > names
Definition: ERF_Mam4Constitutents.H:52
std::vector< std::string > types
Definition: ERF_Mam4Constitutents.H:53
Here is the call graph for this function:

Member Function Documentation

◆ get_aer_lw_abs()

void MamConstituents::get_aer_lw_abs ( int  list_idx,
int  aer_idx,
real1d &  lw_abs 
) const
inline
1080  {
1081  auto aerlist = aerosollist[list_idx];
1082  auto id = aerlist.aer[aer_idx].physprop_id;
1083 
1084  prop.get_lw_abs(id, lw_abs);
1085  }
void get_lw_abs(int &id, real1d &lw_abs) const
Definition: ERF_PhysProp.H:215

Referenced by AerRadProps::aer_rad_props_lw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_aer_lw_hygro_abs()

void MamConstituents::get_aer_lw_hygro_abs ( int  list_idx,
int  aer_idx,
real2d &  lw_hygro_abs 
) const
inline
1026  {
1027  auto aerlist = aerosollist[list_idx];
1028  auto id = aerlist.aer[aer_idx].physprop_id;
1029 
1030  prop.get_lw_hygro_abs(id, lw_hygro_abs);
1031  }
void get_lw_hygro_abs(int &id, real2d &lw_hygro_abs) const
Definition: ERF_PhysProp.H:173

Referenced by AerRadProps::aer_rad_props_lw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_aer_mu()

void MamConstituents::get_aer_mu ( int  list_idx,
int  aer_idx,
real1d &  mu 
) const
inline
1149  {
1150  auto aerlist = aerosollist[list_idx];
1151  auto id = aerlist.aer[aer_idx].physprop_id;
1152 
1153  prop.get_mu(id, mu);
1154  }
void get_mu(int &id, real1d &mu) const
Definition: ERF_PhysProp.H:278

Referenced by AerRadProps::aer_rad_props_lw(), and AerRadProps::aer_rad_props_sw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_aer_opticstype()

void MamConstituents::get_aer_opticstype ( int  list_idx,
int  aer_idx,
std::string &  opticstype 
) const
inline
990  {
991  auto aerlist = aerosollist[list_idx];
992  auto id = aerlist.aer[aer_idx].physprop_id;
993 
994  prop.get_opticstype(id, opticstype);
995  }
void get_opticstype(int &id, std::string &opticstype) const
Definition: ERF_PhysProp.H:145

Referenced by AerRadProps::aer_rad_props_lw(), and AerRadProps::aer_rad_props_sw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_aer_r_lw_abs()

void MamConstituents::get_aer_r_lw_abs ( int  list_idx,
int  aer_idx,
real2d &  r_lw_abs 
) const
inline
1140  {
1141  auto aerlist = aerosollist[list_idx];
1142  auto id = aerlist.aer[aer_idx].physprop_id;
1143 
1144  prop.get_r_lw_abs(id, r_lw_abs);
1145  }
void get_r_lw_abs(int &id, real2d &r_lw_abs) const
Definition: ERF_PhysProp.H:271

Referenced by AerRadProps::aer_rad_props_lw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_aer_r_sw_ascat()

void MamConstituents::get_aer_r_sw_ascat ( int  list_idx,
int  aer_idx,
real2d &  r_sw_ascat 
) const
inline
1131  {
1132  auto aerlist = aerosollist[list_idx];
1133  auto id = aerlist.aer[aer_idx].physprop_id;
1134 
1135  prop.get_r_sw_ascat(id, r_sw_ascat);
1136  }
void get_r_sw_ascat(int &id, real2d &r_sw_ascat) const
Definition: ERF_PhysProp.H:264

Referenced by AerRadProps::aer_rad_props_sw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_aer_r_sw_ext()

void MamConstituents::get_aer_r_sw_ext ( int  list_idx,
int  aer_idx,
real2d &  r_sw_ext 
) const
inline
1113  {
1114  auto aerlist = aerosollist[list_idx];
1115  auto id = aerlist.aer[aer_idx].physprop_id;
1116 
1117  prop.get_r_sw_ext(id, r_sw_ext);
1118  }
void get_r_sw_ext(int &id, real2d &r_sw_ext) const
Definition: ERF_PhysProp.H:250

Referenced by AerRadProps::aer_rad_props_sw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_aer_r_sw_scat()

void MamConstituents::get_aer_r_sw_scat ( int  list_idx,
int  aer_idx,
real2d &  r_sw_scat 
) const
inline
1122  {
1123  auto aerlist = aerosollist[list_idx];
1124  auto id = aerlist.aer[aer_idx].physprop_id;
1125 
1126  prop.get_r_sw_scat(id, r_sw_scat);
1127  }
void get_r_sw_scat(int &id, real2d &r_sw_scat) const
Definition: ERF_PhysProp.H:257

Referenced by AerRadProps::aer_rad_props_sw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_aer_refindex_aer_lw()

void MamConstituents::get_aer_refindex_aer_lw ( int  list_idx,
int  aer_idx,
real1d &  refindex_real_aer_lw,
real1d &  refindex_im_aer_lw 
) const
inline
1103  {
1104  auto aerlist = aerosollist[list_idx];
1105  auto id = aerlist.aer[aer_idx].physprop_id;
1106 
1107  prop.get_ref_real_aer_lw(id, refindex_real_aer_lw);
1108  prop.get_ref_im_aer_lw(id, refindex_im_aer_lw);
1109  }
void get_ref_real_aer_lw(int &id, real1d &ref_real_aer_lw) const
Definition: ERF_PhysProp.H:229
void get_ref_im_aer_lw(int &id, real1d &ref_im_aer_lw) const
Definition: ERF_PhysProp.H:243
Here is the call graph for this function:

◆ get_aer_refindex_aer_sw()

void MamConstituents::get_aer_refindex_aer_sw ( int  list_idx,
int  aer_idx,
real1d &  refindex_real_aer_sw,
real1d &  refindex_im_aer_sw 
) const
inline
1091  {
1092  auto aerlist = aerosollist[list_idx];
1093  auto id = aerlist.aer[aer_idx].physprop_id;
1094 
1095  prop.get_ref_real_aer_sw(id, refindex_real_aer_sw);
1096  prop.get_ref_im_aer_sw(id, refindex_im_aer_sw);
1097  }
void get_ref_real_aer_sw(int &id, real1d &ref_real_aer_sw) const
Definition: ERF_PhysProp.H:222
void get_ref_im_aer_sw(int &id, real1d &ref_im_aer_sw) const
Definition: ERF_PhysProp.H:236
Here is the call graph for this function:

◆ get_aer_sw_hygro_asm()

void MamConstituents::get_aer_sw_hygro_asm ( int  list_idx,
int  aer_idx,
real2d &  sw_hygro_asm 
) const
inline
1017  {
1018  auto aerlist = aerosollist[list_idx];
1019  auto id = aerlist.aer[aer_idx].physprop_id;
1020 
1021  prop.get_sw_hygro_asm(id, sw_hygro_asm);
1022  }
void get_sw_hygro_asm(int &id, real2d &sw_hygro_asm) const
Definition: ERF_PhysProp.H:166

Referenced by AerRadProps::aer_rad_props_sw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_aer_sw_hygro_ext()

void MamConstituents::get_aer_sw_hygro_ext ( int  list_idx,
int  aer_idx,
real2d &  sw_hygro_ext 
) const
inline
999  {
1000  auto aerlist = aerosollist[list_idx];
1001  auto id = aerlist.aer[aer_idx].physprop_id;
1002 
1003  prop.get_sw_hygro_ext(id, sw_hygro_ext);
1004  }
void get_sw_hygro_ext(int &id, real2d &sw_hygro_ext) const
Definition: ERF_PhysProp.H:152

Referenced by AerRadProps::aer_rad_props_sw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_aer_sw_hygro_ssa()

void MamConstituents::get_aer_sw_hygro_ssa ( int  list_idx,
int  aer_idx,
real2d &  sw_hygro_ssa 
) const
inline
1008  {
1009  auto aerlist = aerosollist[list_idx];
1010  auto id = aerlist.aer[aer_idx].physprop_id;
1011 
1012  prop.get_sw_hygro_ssa(id, sw_hygro_ssa);
1013  }
void get_sw_hygro_ssa(int &id, real2d &sw_hygro_ssa) const
Definition: ERF_PhysProp.H:159

Referenced by AerRadProps::aer_rad_props_sw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_aer_sw_nonhygro_ascat()

void MamConstituents::get_aer_sw_nonhygro_ascat ( int  list_idx,
int  aer_idx,
real1d &  sw_nonhygro_ascat 
) const
inline
1071  {
1072  auto aerlist = aerosollist[list_idx];
1073  auto id = aerlist.aer[aer_idx].physprop_id;
1074 
1075  prop.get_sw_nonhygro_ascat(id, sw_nonhygro_ascat);
1076  }
void get_sw_nonhygro_ascat(int &id, real1d &sw_nonhygro_ascat) const
Definition: ERF_PhysProp.H:208

Referenced by AerRadProps::aer_rad_props_sw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_aer_sw_nonhygro_asm()

void MamConstituents::get_aer_sw_nonhygro_asm ( int  list_idx,
int  aer_idx,
real1d &  sw_nonhygro_asm 
) const
inline
1053  {
1054  auto aerlist = aerosollist[list_idx];
1055  auto id = aerlist.aer[aer_idx].physprop_id;
1056 
1057  prop.get_sw_nonhygro_asm(id, sw_nonhygro_asm);
1058  }
void get_sw_nonhygro_asm(int &id, real1d &sw_nonhygro_asm) const
Definition: ERF_PhysProp.H:194

Referenced by AerRadProps::aer_rad_props_sw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_aer_sw_nonhygro_ext()

void MamConstituents::get_aer_sw_nonhygro_ext ( int  list_idx,
int  aer_idx,
real1d &  sw_nonhygro_ext 
) const
inline
1035  {
1036  auto aerlist = aerosollist[list_idx];
1037  auto id = aerlist.aer[aer_idx].physprop_id;
1038 
1039  prop.get_sw_nonhygro_ext(id, sw_nonhygro_ext);
1040  }
void get_sw_nonhygro_ext(int &id, real1d &sw_nonhygro_ext) const
Definition: ERF_PhysProp.H:180

Referenced by AerRadProps::aer_rad_props_sw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_aer_sw_nonhygro_scat()

void MamConstituents::get_aer_sw_nonhygro_scat ( int  list_idx,
int  aer_idx,
real1d &  sw_nonhygro_scat 
) const
inline
1062  {
1063  auto aerlist = aerosollist[list_idx];
1064  auto id = aerlist.aer[aer_idx].physprop_id;
1065 
1066  prop.get_sw_nonhygro_scat(id, sw_nonhygro_scat);
1067  }
void get_sw_nonhygro_scat(int &id, real1d &sw_nonhygro_scat) const
Definition: ERF_PhysProp.H:201

Referenced by AerRadProps::aer_rad_props_sw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_aer_sw_nonhygro_ssa()

void MamConstituents::get_aer_sw_nonhygro_ssa ( int  list_idx,
int  aer_idx,
real1d &  sw_nonhygro_ssa 
) const
inline
1044  {
1045  auto aerlist = aerosollist[list_idx];
1046  auto id = aerlist.aer[aer_idx].physprop_id;
1047 
1048  prop.get_sw_nonhygro_ssa(id, sw_nonhygro_ssa);
1049  }
void get_sw_nonhygro_ssa(int &id, real1d &sw_nonhygro_ssa) const
Definition: ERF_PhysProp.H:187

Referenced by AerRadProps::aer_rad_props_sw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_aername()

void MamConstituents::get_aername ( int  list_idx,
int  aer_idx,
std::string &  aername 
) const
inline
1158  {
1159  auto aerlist = aerosollist[list_idx];
1160  auto id = aerlist.aer[aer_idx].physprop_id;
1161 
1162  prop.get_aername(id, aername);
1163  }
void get_aername(int &id, std::string &aername) const
Definition: ERF_PhysProp.H:341
Here is the call graph for this function:

◆ get_aero_names()

void MamConstituents::get_aero_names ( int  list_idx,
std::vector< std::string > &  aernames 
) const
inline
386  {
387  auto a_list = aerosollist[list_idx];
388 
389  aernames.reserve(a_list.numaerosols);
390 
391  for(auto i = 0; i < a_list.numaerosols; ++i) aernames[i] = a_list.aer[i].camname;
392  }

◆ get_density_aer()

void MamConstituents::get_density_aer ( int  list_idx,
int  aer_idx,
real &  density_aer 
) const
inline
1167  {
1168  auto aerlist = aerosollist[list_idx];
1169  auto id = aerlist.aer[aer_idx].physprop_id;
1170 
1171  prop.get_density_aer(id, density_aer);
1172  }
void get_density_aer(int &id, real &density_aer) const
Definition: ERF_PhysProp.H:348
Here is the call graph for this function:

◆ get_dispersion_aer()

void MamConstituents::get_dispersion_aer ( int  list_idx,
int  aer_idx,
real &  dispersion_aer 
) const
inline
1194  {
1195  auto aerlist = aerosollist[list_idx];
1196  auto id = aerlist.aer[aer_idx].physprop_id;
1197 
1198  prop.get_dispersion_aer(id, dispersion_aer);
1199  }
void get_dispersion_aer(int &id, real &dispersion_aer) const
Definition: ERF_PhysProp.H:369
Here is the call graph for this function:

◆ get_dryrad_aer()

void MamConstituents::get_dryrad_aer ( int  list_idx,
int  aer_idx,
real &  dryrad_aer 
) const
inline
1185  {
1186  auto aerlist = aerosollist[list_idx];
1187  auto id = aerlist.aer[aer_idx].physprop_id;
1188 
1189  prop.get_dryrad_aer(id, dryrad_aer);
1190  }
void get_dryrad_aer(int &id, real &dryrad_aer) const
Definition: ERF_PhysProp.H:362
Here is the call graph for this function:

◆ get_gas_names()

void MamConstituents::get_gas_names ( int  list_idx,
std::vector< std::string > &  gasnames,
bool &  use_data_o3 
) const
inline
369  {
370  auto g_list = gaslist[list_idx];
371 
372  gasnames.reserve(g_list.ngas);
373 
374  for(auto i = 0; i < g_list.ngas; ++i) gasnames[i] = g_list.gas[i].camname;
375 
376  // Does the climate calculation use data ozone?
377  // get index of O3 in gas list
378  auto igas = RadConstants::rad_gas_index("O3");
379  // Get data source
380  auto source = g_list.gas[igas].source;
381  use_data_o3 = false;
382  if (source == "N") use_data_o3 = true;
383  }
static int rad_gas_index(std::string gasname)
Definition: ERF_RadConstants.H:255
Here is the call graph for this function:

◆ get_hygro_aer()

void MamConstituents::get_hygro_aer ( int  list_idx,
int  aer_idx,
real &  hygro_aer 
) const
inline
1176  {
1177  auto aerlist = aerosollist[list_idx];
1178  auto id = aerlist.aer[aer_idx].physprop_id;
1179 
1180  prop.get_hygro_aer(id, hygro_aer);
1181  }
void get_hygro_aer(int &id, real &hygro_aer) const
Definition: ERF_PhysProp.H:355
Here is the call graph for this function:

◆ get_mam_density_aer()

void MamConstituents::get_mam_density_aer ( int  list_idx,
int  mode_idx,
int  spec_idx,
real &  density_aer 
) const
inline
891  {
892  modelist_t mlist;
893  if (list_idx >= 0 && list_idx <= N_DIAG)
894  mlist = ma_list[list_idx];
895 
896  // Get the index for the corresponding mode in the mode definition object
897  auto m_idx = mlist.idx[mode_idx];
898  auto id = modes.comps[m_idx].idx_props[spec_idx];
899  prop.get_density_aer(id, density_aer);
900  }

Referenced by ModalAeroWateruptake::modal_aero_wateruptake_dr().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_mam_hygro_aer()

void MamConstituents::get_mam_hygro_aer ( int  list_idx,
int  mode_idx,
int  spec_idx,
real &  hygro_aer 
) const
inline
905  {
906  modelist_t mlist;
907  if (list_idx >= 0 && list_idx <= N_DIAG)
908  mlist = ma_list[list_idx];
909 
910  // Get the index for the corresponding mode in the mode definition object
911  auto m_idx = mlist.idx[mode_idx];
912  auto id = modes.comps[m_idx].idx_props[spec_idx];
913  prop.get_hygro_aer(id, hygro_aer);
914  }

Referenced by ModalAeroWateruptake::modal_aero_wateruptake_dr().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_mam_props() [1/2]

void MamConstituents::get_mam_props ( int  list_idx,
int  mode_idx,
int  spec_idx,
real &  density_aer 
) const
inline
958  {
959  modelist_t mlist;
960  if (list_idx >= 0 && list_idx <= N_DIAG)
961  mlist = ma_list[list_idx];
962 
963  auto m_idx = mlist.idx[mode_idx];
964  auto id = modes.comps[m_idx].idx_props[spec_idx];
965 
966  prop.get_density_aer(id, density_aer);
967  }
Here is the call graph for this function:

◆ get_mam_props() [2/2]

void MamConstituents::get_mam_props ( int  list_idx,
int  mode_idx,
int  spec_idx,
real &  density_aer,
std::string &  spectype,
real &  hygro_aer,
real1d &  refindex_real_aer_sw,
real1d &  refindex_im_aer_sw 
) const
inline
922  {
923  modelist_t mlist;
924  if (list_idx >= 0 && list_idx <= N_DIAG)
925  mlist = ma_list[list_idx];
926 
927  // Get the index for the corresponding mode in the mode definition object
928  auto m_idx = mlist.idx[mode_idx];
929  auto id = modes.comps[m_idx].idx_props[spec_idx];
930 
931  prop.get_density_aer(id, density_aer);
932  prop.get_hygro_aer(id, hygro_aer);
933  prop.get_ref_real_aer_sw(id, refindex_real_aer_sw);
934  prop.get_ref_im_aer_sw(id, refindex_im_aer_sw);
935  spectype = modes.comps[m_idx].type[spec_idx];
936  }

Referenced by Mam4_aer::modal_aero_calcsize_diag(), and Mam4_aer::modal_aero_sw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_mam_props_lw()

void MamConstituents::get_mam_props_lw ( int  list_idx,
int  mode_idx,
int  spec_idx,
real &  density_aer,
real1d &  refindex_real_aer_lw,
real1d &  refindex_im_aer_lw 
) const
inline
974  {
975  modelist_t mlist;
976  if (list_idx >= 0 && list_idx <= N_DIAG)
977  mlist = ma_list[list_idx];
978 
979  // Get the index for the corresponding mode in the mode definition object
980  auto m_idx = mlist.idx[mode_idx];
981  auto id = modes.comps[m_idx].idx_props[spec_idx];
982 
983  prop.get_density_aer(id, density_aer);
984  prop.get_ref_real_aer_lw(id, refindex_real_aer_lw);
985  prop.get_ref_im_aer_lw(id, refindex_im_aer_lw);
986  }

Referenced by Mam4_aer::modal_aero_lw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_mam_props_sw()

void MamConstituents::get_mam_props_sw ( int  list_idx,
int  mode_idx,
int  spec_idx,
real &  density_aer,
real1d &  refindex_real_aer_sw,
real1d &  refindex_im_aer_sw 
) const
inline
942  {
943  modelist_t mlist;
944  if (list_idx >= 0 && list_idx <= N_DIAG)
945  mlist = ma_list[list_idx];
946 
947  // Get the index for the corresponding mode in the mode definition object
948  auto m_idx = mlist.idx[mode_idx];
949  auto id = modes.comps[m_idx].idx_props[spec_idx];
950 
951  prop.get_density_aer(id, density_aer);
952  prop.get_ref_real_aer_sw(id, refindex_real_aer_sw);
953  prop.get_ref_im_aer_sw(id, refindex_im_aer_sw);
954  }

Referenced by Mam4_aer::modal_aero_sw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_mode_nspec()

void MamConstituents::get_mode_nspec ( int  list_idx,
int  m_idx,
int &  nspec 
) const
inline
395  {
396  auto m_list = ma_list[list_idx];
397  auto mm = m_list.idx[m_idx];
398 
399  // number of species in the mode
400  nspec = modes.comps[mm].nspec;
401  }

Referenced by Mam4_aer::modal_aero_calcsize_diag(), Mam4_aer::modal_aero_lw(), Mam4_aer::modal_aero_sw(), and ModalAeroWateruptake::modal_aero_wateruptake_dr().

Here is the caller graph for this function:

◆ get_mode_props() [1/5]

void MamConstituents::get_mode_props ( int  list_idx,
int  mode_idx,
int &  ncoef,
int &  prefr,
int &  prefi 
) const
inline
858  {
859  modelist_t mlist;
860  if (list_idx >= 0 && list_idx <= N_DIAG)
861  mlist = ma_list[list_idx];
862 
863  // Get the physprop index for the requested mode
864  auto id = mlist.idx_props[mode_idx];
865 
866  prop.get_ncoef(id, ncoef);
867  prop.get_prefr(id, prefr);
868  prop.get_prefi(id, prefi);
869  }
void get_prefr(int &id, int &prefr) const
Definition: ERF_PhysProp.H:390
void get_ncoef(int &id, int &ncoef) const
Definition: ERF_PhysProp.H:383
void get_prefi(int &id, int &prefi) const
Definition: ERF_PhysProp.H:397
Here is the call graph for this function:

◆ get_mode_props() [2/5]

void MamConstituents::get_mode_props ( int  list_idx,
int  mode_idx,
real &  dgnum,
real &  dgnumhi,
real &  dgnumlo,
real &  sigmag 
) const
inline
874  {
875  modelist_t mlist;
876  if (list_idx >= 0 && list_idx <= N_DIAG)
877  mlist = ma_list[list_idx];
878 
879  // Get the physprop index for the requested mode
880  auto id = mlist.idx_props[mode_idx];
881 
882  prop.get_dgnum(id, dgnum);
883  prop.get_dgnumhi(id, dgnumhi);
884  prop.get_dgnumlo(id, dgnumlo);
885  prop.get_sigmag(id, sigmag);
886  }
void get_sigmag(int &id, real &sigmag) const
Definition: ERF_PhysProp.H:404
void get_dgnum(int &id, real &dgnum) const
Definition: ERF_PhysProp.H:411
void get_dgnumlo(int &id, real &dgnumlo) const
Definition: ERF_PhysProp.H:418
void get_dgnumhi(int &id, real &dgnumhi) const
Definition: ERF_PhysProp.H:425
Here is the call graph for this function:

◆ get_mode_props() [3/5]

void MamConstituents::get_mode_props ( int  list_idx,
int  mode_idx,
real &  sigmag,
real &  rhcrystal,
real &  rhdeliques 
) const
inline
810  {
811  modelist_t mlist;
812  if (list_idx >= 0 && list_idx <= N_DIAG)
813  mlist = ma_list[list_idx];
814 
815  // Get the physprop index for the requested mode
816  auto id = mlist.idx_props[mode_idx];
817 
818  prop.get_sigmag(id, sigmag);
819  prop.get_rhcrystal(id, rhcrystal);
820  prop.get_rhdeliques(id, rhdeliques);
821  }
void get_rhdeliques(int &id, real &rhdeliques) const
Definition: ERF_PhysProp.H:439
void get_rhcrystal(int &id, real &rhcrystal) const
Definition: ERF_PhysProp.H:432

Referenced by Mam4_aer::initialize(), Mam4_aer::modal_aero_calcsize_diag(), Mam4_aer::modal_aero_lw(), Mam4_aer::modal_aero_sw(), and ModalAeroWateruptake::modal_aero_wateruptake_dr().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_mode_props() [4/5]

void MamConstituents::get_mode_props ( int  list_idx,
int  mode_idx,
real &  sigmag,
real2d &  refrtablw,
real2d &  refitablw,
real4d &  absplw 
) const
inline
825  {
826  modelist_t mlist;
827  if (list_idx >= 0 && list_idx <= N_DIAG)
828  mlist = ma_list[list_idx];
829 
830  // Get the physprop index for the requested mode
831  auto id = mlist.idx_props[mode_idx];
832 
833  prop.get_sigmag(id, sigmag);
834  prop.get_refrtablw(id, refrtablw);
835  prop.get_refitablw(id, refitablw);
836  prop.get_absplw(id, absplw);
837  }
void get_refitablw(int &id, real2d &refitablw) const
Definition: ERF_PhysProp.H:334
void get_refrtablw(int &id, real2d &refrtablw) const
Definition: ERF_PhysProp.H:327
void get_absplw(int &id, real4d &absplw) const
Definition: ERF_PhysProp.H:306
Here is the call graph for this function:

◆ get_mode_props() [5/5]

void MamConstituents::get_mode_props ( int  list_idx,
int  mode_idx,
real &  sigmag,
real2d &  refrtabsw,
real2d &  refitabsw,
real4d &  extpsw,
real4d &  abspsw,
real4d &  asmpsw 
) const
inline
841  {
842  modelist_t mlist;
843  if (list_idx >= 0 && list_idx <= N_DIAG)
844  mlist = ma_list[list_idx];
845 
846  // Get the physprop index for the requested mode
847  auto id = mlist.idx_props[mode_idx];
848 
849  prop.get_sigmag(id, sigmag);
850  prop.get_refrtabsw(id, refrtabsw);
851  prop.get_refitabsw(id, refitabsw);
852  prop.get_extpsw(id, extpsw);
853  prop.get_abspsw(id, abspsw);
854  prop.get_asmpsw(id, asmpsw);
855  }
void get_abspsw(int &id, real4d &abspsw) const
Definition: ERF_PhysProp.H:292
void get_extpsw(int &id, real4d &extpsw) const
Definition: ERF_PhysProp.H:285
void get_refrtabsw(int &id, real2d &refrtabsw) const
Definition: ERF_PhysProp.H:313
void get_asmpsw(int &id, real4d &asmpsw) const
Definition: ERF_PhysProp.H:299
void get_refitabsw(int &id, real2d &refitabsw) const
Definition: ERF_PhysProp.H:320
Here is the call graph for this function:

◆ get_naero()

void MamConstituents::get_naero ( int  list_idx,
int &  naero 
) const
inline
363  {
364  auto a_list = aerosollist[list_idx];
365  naero = a_list.numaerosols;
366  }

Referenced by AerRadProps::aer_rad_props_lw(), and AerRadProps::aer_rad_props_sw().

Here is the caller graph for this function:

◆ get_ngas()

void MamConstituents::get_ngas ( int  list_idx,
int &  ngas 
) const
inline
357  {
358  auto g_list = gaslist[list_idx];
359  ngas = g_list.ngas;
360  }

Referenced by AerRadProps::aer_rad_props_sw().

Here is the caller graph for this function:

◆ get_nmodes()

void MamConstituents::get_nmodes ( int  list_idx,
int &  nmodes 
) const
inline
351  {
352  auto m_list = ma_list[list_idx];
353  nmodes = m_list.nmodes;
354  }

Referenced by AerRadProps::aer_rad_props_lw(), AerRadProps::aer_rad_props_sw(), and Mam4_aer::initialize().

Here is the caller graph for this function:

◆ get_num_to_mass_aer()

void MamConstituents::get_num_to_mass_aer ( int  list_idx,
int  aer_idx,
real &  num_to_mass_aer 
) const
inline
1203  {
1204  auto aerlist = aerosollist[list_idx];
1205  auto id = aerlist.aer[aer_idx].physprop_id;
1206 
1207  prop.get_num_to_mass_aer(id, num_to_mass_aer);
1208  }
void get_num_to_mass_aer(int &id, real &num_to_mass_aer) const
Definition: ERF_PhysProp.H:376
Here is the call graph for this function:

◆ init_mode_comps()

void MamConstituents::init_mode_comps ( )
inline
304  {
305  for(auto m = 0; m < modes.nmodes; ++m) {
306  for(auto ispec = 0; ispec < modes.comps[m].nspec; ++ispec) {
307  modes.comps[m].idx_props[ispec] = prop.physprop_get_id(modes.comps[m].props[ispec]);
308  if (modes.comps[m].idx_props[ispec] == -1)
309  amrex::Print() << "ERROR idx not found for " << modes.comps[m].props[ispec] << std::endl;
310  }
311  }
312  }
int physprop_get_id(std::string filename) const
Definition: ERF_PhysProp.H:125

Referenced by rad_cnst_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rad_cnst_get_aer_idx()

int MamConstituents::rad_cnst_get_aer_idx ( int  list_idx,
std::string &  aer_name 
) const
inline
781  {
782  aerlist_t aerlist;
783 
784  if (list_idx >= 0 && list_idx <= N_DIAG) {
785  aerlist = aerosollist[list_idx];
786  }
787  else {
788  amrex::Print() << " list_idx =" << list_idx << std::endl;
789  exit(0);
790  }
791 
792  // Get index in aerosol list for requested name
793  auto aer_idx = -1;
794  for(auto i = 0; i < aerlist.numaerosols; ++i) {
795  if (aer_name == aerlist.aer[i].camname) {
796  aer_idx = i;
797  exit(0);
798  }
799  }
800 
801  if (aer_idx == -1) exit(0);
802 
803  return aer_idx;
804  }

◆ rad_cnst_get_aer_mmr_by_idx()

void MamConstituents::rad_cnst_get_aer_mmr_by_idx ( int  list_idx,
int  aer_idx,
real2d &  mmr 
) const
inline
616  {
617  aerlist_t aerlist;
618 
619  if (list_idx >= 0 && list_idx <= N_DIAG) {
620  aerlist = aerosollist[list_idx];
621  } else {
622  amrex::Print() << " list_idx = " << list_idx << std::endl;
623  exit(0);
624  }
625 
626  // Check for valid input aerosol index
627  if (aer_idx < 0 || aer_idx > aerlist.numaerosols) {
628  amrex::Print() << " aer_idx= " << aer_idx << " numaerosols= " << aerlist.numaerosols << std::endl;
629  exit(0);
630  }
631 
632  // Get data source
633  auto source = aerlist.aer[aer_idx].source;
634  //auto idx = aerlist.aer[aer_idx].idx;
635  }

◆ rad_cnst_get_gas()

void MamConstituents::rad_cnst_get_gas ( int  list_idx,
const std::string &  gasname,
real2d &  mmr 
) const
inline
318  {
319  gaslist_t list;
320  if (list_idx >= 0 && list_idx <= N_DIAG) {
321  list = gaslist[list_idx];
322  } else {
323  amrex::Print() << " list_idx= " << list_idx << "\n";
324  }
325 
326  // Get index of gas in internal arrays. rad_gas_index will abort if the
327  // specified gasname is not recognized by the radiative transfer code.
328  auto igas = RadConstants::rad_gas_index(gasname);
329 
330  // Get data source
331  auto source = list.gas[igas].source;
332  auto idx = list.gas[igas].idx;
333 
334  if (idx == 7) {
335  yakl::memset(mmr, 0.23);
336  } else {
337  yakl::memset(mmr, 1.0e-6);
338  }
339 
340  // select case( source )
341  // case ('A')
342  // mmr => state%q(:,:,idx)
343  // case ('N')
344  // pbuf_get_field(pbuf, idx, mmr)
345  // case ('Z')
346  // mmr => zero_cols
347  // end select
348  }
Here is the call graph for this function:

◆ rad_cnst_get_info_by_mode()

void MamConstituents::rad_cnst_get_info_by_mode ( int  list_idx,
int  m_idx,
std::string &  mode_type,
std::string &  num_name,
std::string &  num_name_cw,
int &  nspec 
) const
inline
407  {
408  auto m_list = ma_list[list_idx];
409 
410  // check for valid mode index
411  auto nmodes = m_list.nmodes;
412  if (m_idx < 0 || m_idx > nmodes)
413  amrex::Print() << "ERROR - invalid mode index: " << m_idx << "\n";
414 
415  // get index into the mode definition object
416  auto mm = m_list.idx[m_idx];
417 
418  // mode type
419  if (mode_type.empty()) mode_type = modes.types[mm];
420 
421  // number of species in the mode
422  if (nspec == 0) nspec = modes.comps[mm].nspec;
423 
424  // name of interstitial number mixing ratio
425  if (num_name.empty()) num_name = modes.comps[mm].camname_num_a;
426 
427  // name of cloud borne number mixing ratio
428  if (num_name_cw.empty()) num_name_cw = modes.comps[mm].camname_num_c;
429  }

◆ rad_cnst_get_info_by_mode_spec()

void MamConstituents::rad_cnst_get_info_by_mode_spec ( int  list_idx,
int  m_idx,
int  s_idx,
std::string &  spec_type,
std::string &  spec_name,
std::string &  spec_name_cw 
) const
inline
435  {
436  auto m_list = ma_list[list_idx];
437 
438  // check for valid mode index
439  auto nmodes = m_list.nmodes;
440  if (m_idx < 0 || m_idx > nmodes)
441  amrex::Print() << "ERROR - invalid mode index: " << m_idx << "\n";
442 
443  // get index into the mode definition object
444  auto mm = m_list.idx[m_idx];
445 
446  // check for valid specie index
447  auto nspec = modes.comps[mm].nspec;
448  if (s_idx < 0 || s_idx > nspec)
449  amrex::Print() << "ERROR - invalid specie index: " << s_idx << "\n";
450 
451  // specie type
452  if (spec_type.empty()) spec_type = modes.comps[mm].type[s_idx];
453 
454  // interstitial specie name
455  if (spec_name.empty()) spec_name = modes.comps[mm].camname_mmr_a[s_idx];
456 
457  // cloud borne specie name
458  if (spec_name_cw.empty()) spec_name_cw = modes.comps[mm].camname_mmr_c[s_idx];
459  }

◆ rad_cnst_get_info_by_spectype()

void MamConstituents::rad_cnst_get_info_by_spectype ( int  list_idx,
const std::string &  spectype,
int &  mode_idx,
int &  spec_idx 
) const
inline
464  {
465  auto m_list = ma_list[list_idx];
466 
467  // number of modes in specified list
468  auto nmodes = m_list.nmodes;
469 
470  // loop through modes in specified climate/diagnostic list
471  auto found_spectype = false;
472  for(auto i = 0; i < nmodes; ++i) {
473 
474  // get index of the mode in the definition object
475  auto m_idx = m_list.idx[i];
476 
477  // number of species in the mode
478  auto nspec = modes.comps[m_idx].nspec;
479 
480  // loop through species looking for spectype
481  for(auto ispec = 0; ispec < nspec; ++ispec) {
482  if (modes.comps[m_idx].type[ispec] == spectype) {
483  if (mode_idx) mode_idx = i;
484  if (spec_idx) spec_idx = ispec;
485  found_spectype = true;
486  exit(0);
487  }
488  }
489  if (found_spectype) exit(0);
490  }
491 
492  if (!found_spectype) {
493  mode_idx = -1;
494  spec_idx = -1;
495  }
496  }

◆ rad_cnst_get_mam_mmr_by_idx()

void MamConstituents::rad_cnst_get_mam_mmr_by_idx ( int  list_idx,
int  mode_idx,
int  spec_idx,
const std::string &  phase,
real2d &  mmr 
) const
inline
641  {
642  //int idx;
643  std::string source;
644  modelist_t mlist;
645 
646  if (list_idx >= 0 && list_idx <= N_DIAG) {
647  mlist = ma_list[list_idx];
648  } else {
649  amrex::Print() << "list_idx =" << list_idx << std::endl;
650  exit(0);
651  }
652 
653  // Check for valid mode index
654  if (mode_idx < 0 || mode_idx > mlist.nmodes) {
655  amrex::Print() << " mode_idx= " << mode_idx << " nmodes= " << mlist.nmodes << std::endl;
656  exit(0);
657  }
658 
659  // Get the index for the corresponding mode in the mode definition object
660  auto m_idx = mlist.idx[mode_idx];
661 
662  // Check for valid specie index
663  if (spec_idx < 0 || spec_idx > modes.comps[m_idx].nspec) {
664  amrex::Print() << " spec_idx= " << spec_idx << " nspec= " << modes.comps[m_idx].nspec << std::endl;
665  exit(0);
666  }
667 
668  yakl::memset(mmr, 1.80e-17);
669 
670  // Get data source
671  if (phase == "a") {
672  // source = modes.comps[m_idx].source_mmr_a[spec_idx];
673  // idx = modes.comps[m_idx].idx_mmr_a[spec_idx];
674  } else if (phase == "c") {
675  // source = modes.comps[m_idx].source_mmr_c[spec_idx];
676  // idx = modes.comps[m_idx].idx_mmr_c[spec_idx];
677  } else {
678  amrex::Print() << "phase= " << phase << std::endl;
679  exit(0);
680  }
681  }

Referenced by Mam4_aer::modal_aero_calcsize_diag(), Mam4_aer::modal_aero_lw(), Mam4_aer::modal_aero_sw(), and ModalAeroWateruptake::modal_aero_wateruptake_dr().

Here is the caller graph for this function:

◆ rad_cnst_get_mam_mmr_idx()

void MamConstituents::rad_cnst_get_mam_mmr_idx ( int  mode_idx,
int  spec_idx,
int &  idx 
) const
inline
684  {
685  modelist_t mlist;
686 
687  // assume climate list (i.e., species are in the constituent array)
688  mlist = ma_list[0];
689 
690  // Check for valid mode index
691  if (mode_idx < 0 || mode_idx > mlist.nmodes) {
692  amrex::Print() << "mode_idx= " << mode_idx << " nmodes= " << mlist.nmodes << std::endl;
693  exit(0);
694  }
695 
696  // Get the index for the corresponding mode in the mode definition object
697  auto m_idx = mlist.idx[mode_idx];
698 
699  // Check for valid specie index
700  if (spec_idx < 0 || spec_idx > modes.comps[m_idx].nspec) {
701  amrex::Print() << "spec_idx= " << spec_idx << " nspec= " << modes.comps[m_idx].nspec << std::endl;
702  exit(0);
703  }
704 
705  // Assume data source is interstitial since that's what's in the constituent array
706  // idx = modes.comps[m_idx].idx_mmr_a[spec_idx];
707  }

◆ rad_cnst_get_mode_idx()

int MamConstituents::rad_cnst_get_mode_idx ( int  list_idx,
const std::string &  mode_type 
) const
inline
499  {
500  // if mode type not found return -1
501  int mode_idx = -1;
502 
503  // specified mode list
504  auto m_list = ma_list[list_idx];
505 
506  // number of modes in specified list
507  auto nmodes = m_list.nmodes;
508 
509  // loop through modes in specified climate/diagnostic list
510  for(auto i = 0; i < nmodes; ++i) {
511  // get index of the mode in the definition object
512  auto m_idx = m_list.idx[i];
513 
514  // look in mode definition object (modes) for the mode types
515  if (modes.types[m_idx] == mode_type) {
516  mode_idx = i;
517  exit(0);
518  }
519  }
520  return mode_idx;
521  }

◆ rad_cnst_get_mode_num()

void MamConstituents::rad_cnst_get_mode_num ( int  list_idx,
int  mode_idx,
const std::string &  phase,
real2d &  num 
) const
inline
712  {
713  modelist_t mlist;
714  std::string source;
715  //int idx;
716 
717  if (list_idx >= 0 && list_idx <= N_DIAG) {
718  mlist = ma_list[list_idx];
719  } else {
720  amrex::Print() << " list_idx =" << list_idx << std::endl;
721  exit(0);
722  }
723 
724  // Check for valid mode index
725  if (mode_idx < 0 || mode_idx > mlist.nmodes) {
726  amrex::Print() << " mode_idx= " << mode_idx << " nmodes= " << mlist.nmodes << std::endl;
727  exit(0);
728  }
729 
730  // Get the index for the corresponding mode in the mode definition object
731  auto m_idx = mlist.idx[mode_idx];
732 
733  // Get data source
734  if (phase == "a") {
735  source = modes.comps[m_idx].source_num_a;
736  // idx = modes.comps[m_idx].idx_num_a;
737  } else if (phase == "c") {
738  source = modes.comps[m_idx].source_num_c;
739  // idx = modes.comps[m_idx].idx_num_c;
740  } else {
741  amrex::Print() << " phase= " << phase << std::endl;
742  exit(1);
743  }
744  }

Referenced by Mam4_aer::modal_aero_calcsize_diag().

Here is the caller graph for this function:

◆ rad_cnst_get_mode_num_idx()

void MamConstituents::rad_cnst_get_mode_num_idx ( int  mode_idx,
int &  cnst_idx 
) const
inline
754  {
755  modelist_t mlist;
756  // assume climate list
757  mlist = ma_list[0];
758 
759  // Check for valid mode index
760  if (mode_idx < 0 || mode_idx > mlist.nmodes) {
761  amrex::Print() << " mode_idx= " << mode_idx << " nmodes= " << mlist.nmodes << std::endl;
762  exit(0);
763  }
764 
765  // Get the index for the corresponding mode in the mode definition object
766  auto m_idx = mlist.idx[mode_idx];
767 
768  // Check that source is 'A' which means the index is for the constituent array
769  auto source = modes.comps[m_idx].source_num_a;
770  if (source != "a") {
771  amrex::Print() << " source= " << source << std::endl;
772  exit(0);
773  }
774 
775  // Return index in constituent array
776  // cnst_idx = modes.comps[m_idx].idx_num_a;
777  }

◆ rad_cnst_get_spec_idx()

int MamConstituents::rad_cnst_get_spec_idx ( int  list_idx,
int  mode_idx,
const std::string &  spec_type 
) const
inline
525  {
526  // if specie type not found return -1
527  int spec_idx = -1;
528 
529  // modes in specified list
530  auto m_list = ma_list[list_idx];
531 
532  // get index of the specified mode in the definition object
533  auto m_idx = m_list.idx[mode_idx];
534 
535  // object containing the components of the mode
536  auto mode_comps = modes.comps[m_idx];
537 
538  // number of species in specified mode
539  auto nspec = mode_comps.nspec;
540 
541  // loop through species in specified mode
542  for(auto i=0; i<nspec; ++i) {
543  // look in mode definition object (modes) for the mode types
544  if (mode_comps.type[i] == spec_type) {
545  spec_idx = i;
546  exit(0);
547  }
548  }
549  return spec_idx;
550  }

◆ rad_cnst_init()

void MamConstituents::rad_cnst_init ( )
inline
279  {
280  //int num_aerosols;
281  //constexpr bool stricttest = true;
282 
283  // memory to point to if zero value requested
284  //allocate(zero_cols(pcols,pver))
285  //zero_cols = 0.;
286 
287  // Allocate storage for the physical properties of each aerosol; read properties from
288  // the data files.
290 
291  // Finish initializing the mode definitions.
292  init_mode_comps();
293 
294  for(auto i = 0; i < ma_list.size(); ++i) {
295  for(auto imode = 0; imode < ma_list[i].nmodes; ++imode) {
296  // get the physprop_id from the phys_prop module
297  ma_list[i].idx_props[imode] = prop.physprop_get_id(ma_list[i].physprop_files[imode]);
298  }
299  }
300  }
void init_mode_comps()
Definition: ERF_Mam4Constitutents.H:303
void physprop_init()
Definition: ERF_PhysProp.H:112

Referenced by MamConstituents().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rad_cnst_out()

void MamConstituents::rad_cnst_out ( int  list_idx) const
inline
555  {
556  //int ncol;
557  int idx;
558  amrex::ignore_unused(idx);
559  std::string name, cbname, source;
560 
561  aerlist_t aerlist;
562  // Associate pointer with requested aerosol list
563  if (list_idx >= 0 && list_idx <= N_DIAG) {
564  aerlist = aerosollist[list_idx];
565  } else {
566  amrex::Print() << "list_idx = " << list_idx << "\n";
567  }
568 
569  auto naer = aerlist.numaerosols;
570  for(auto i = 0; i < naer; ++i) {
571  source = aerlist.aer[i].source;
572  idx = aerlist.aer[i].idx;
573  name = aerlist.aer[i].mass_name;
574  // construct name for column burden field by replacing the 'm_' prefix by 'cb_'
575  cbname = "cb_"; // name(3:len_trim(name))
576 
577  // select case( source )
578  // case ('A')
579  // mmr => state%q(:,:,idx)
580  // case ('N')
581  // call pbuf_get_field(pbuf, idx, mmr)
582  // end select
583 
584  // mass(:ncol,:) = mmr(:ncol,:) * state%pdeldry(:ncol,:) * rga
585 
586  // cb(:ncol) = sum(mass(:ncol,:),2);
587 
588  }
589 
590  // Associate pointer with requested gas list
591  auto g_list = gaslist[list_idx];
592 
593  auto ngas = g_list.ngas;
594  for(auto i = 0; i < ngas; ++i) {
595  source = g_list.gas[i].source;
596  idx = g_list.gas[i].idx;
597  name = g_list.gas[i].mass_name;
598  cbname = "cb_"; // name(3:len_trim(name))
599 
600  // select case( source )
601  // case ('A')
602  // mmr => state%q(:,:,idx)
603  // case ('N')
604  // call pbuf_get_field(pbuf, idx, mmr)
605  // end select
606 
607  // mass(:ncol,:) = mmr(:ncol,:) * state%pdeldry(:ncol,:) * rga
608 
609  // cb(:ncol) = sum(mass(:ncol,:),2)
610  }
611  }

Member Data Documentation

◆ aerosollist

◆ gaslist

std::vector<gaslist_t> MamConstituents::gaslist

◆ icecldoptics

std::string MamConstituents::icecldoptics

◆ iceopticsfile

std::string MamConstituents::iceopticsfile

◆ liqcldoptics

std::string MamConstituents::liqcldoptics

◆ liqopticsfile

std::string MamConstituents::liqopticsfile

◆ ma_list

◆ mode_type_names

const std::vector<std::string> MamConstituents::mode_type_names
Initial value:
{"accum", "aitken", "primary_carbon", "fine_seasalt",
"fine_dust", "coarse", "coarse_seasalt", "coarse_dust"}

◆ modes

◆ N_DIAG

◆ n_rad_cnst

const int MamConstituents::n_rad_cnst = 30

◆ num_mode_types

const int MamConstituents::num_mode_types = 8

◆ num_spec_types

const int MamConstituents::num_spec_types = 8

◆ oldcldoptics

const bool MamConstituents::oldcldoptics = false

◆ prop

◆ spec_type_names

const std::vector<std::string> MamConstituents::spec_type_names
Initial value:
{"sulfate", "ammonium", "nitrate", "p-organic",
"s-organic", "black-c", "seasalt", "dust"}

The documentation for this class was generated from the following file: