ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_Mam4_constituents.H
Go to the documentation of this file.
1 //
2 // Provide constituent distributions and properties to the radiation and
3 // cloud microphysics routines.
4 //
5 // The logic to control which constituents are used in the climate calculations
6 // and which are used in diagnostic radiation calculations is contained in this module.
7 //
8 #include <cstdlib>
9 #include "YAKL_netcdf.h"
10 #include "rrtmgp_const.h"
11 #include "ERF_Phys_prop.H"
12 #include "ERF_Rad_constants.H"
13 #include "ERF_Config.H"
14 
15 #ifndef ERF_MAM4_CONSTITUENTS_H_
16 #define ERF_MAM4_CONSTITUENTS_H_
17 
19  public:
20  const int N_DIAG = 10;
22  std::string icecldoptics, liqcldoptics;
23  const bool oldcldoptics = false;
24 
25  // max number of externally mixed entities in the climate/diag lists
26  const int n_rad_cnst = 30; //N_RAD_CNST (hard coded here)
27 
28  // type to provide access to the components of a mode
30  int nspec;
31  // For "source" variables below, value is:
32  std::string source_num_a; // source of interstitial number conc field
33  std::string camname_num_a; // name registered in pbuf or constituents for number mixing ratio of interstitial species
34  std::string source_num_c; // source of cloud borne number conc field
35  std::string camname_num_c; // name registered in pbuf or constituents for number mixing ratio of cloud borne species
36  std::vector<std::string> source_mmr_a; // source of interstitial specie mmr fields
37  std::vector<std::string> camname_mmr_a; // name registered in pbuf or constituents for mmr of interstitial components
38  std::vector<std::string> source_mmr_c; // source of cloud borne specie mmr fields
39  std::vector<std::string> camname_mmr_c; // name registered in pbuf or constituents for mmr of cloud borne components
40  std::vector<std::string> type; // specie type (as used in MAM code)
41  std::vector<std::string> props; // file containing specie properties
42  int idx_num_a; // index in pbuf or constituents for number mixing ratio of interstitial species
43  int idx_num_c; // index in pbuf for number mixing ratio of interstitial species
44  std::vector<int> idx_mmr_a; // index in pbuf or constituents for mmr of interstitial species
45  std::vector<int> idx_mmr_c; // index in pbuf for mmr of interstitial species
46  std::vector<int> idx_props; // ID used to access physical properties of mode species from phys_prop module
47  };
48 
49  // type to provide access to all modes
50  struct modes_t {
51  int nmodes;
52  std::vector<std::string> names; // names used to identify a mode in the climate/diag lists
53  std::vector<std::string> types; // type of mode (as used in MAM code)
54  std::vector<mode_component_t> comps; // components which define the mode
55  };
56 
57  //Storage for gas components in the climate/diagnostic lists
58  struct gas_t {
59  std::string source; // A for state (advected), N for pbuf (non-advected), Z for zero
60  std::string camname; // name of constituent in physics state or buffer
61  std::string mass_name; // name for mass per layer field in history output
62  int idx; // index from constituents or from pbuf
63  };
64 
65  struct gaslist_t {
66  int ngas;
67  std::string list_id;
68  std::vector<gas_t> gas; // dimension(ngas) where ngas = nradgas is from radconstants
69  };
70 
71  //Storage for bulk aerosol components in the climate/diagnostic lists
72  struct aerosol_t {
73  std::string source; // A for state (advected), N for pbuf (non-advected), Z for zero
74  std::string camname; // name of constituent in physics state or buffer
75  std::string physprop_file; // physprop filename
76  std::string mass_name; // name for mass per layer field in history output
77  int idx; // index of constituent in physics state or buffer
78  int physprop_id; // ID used to access physical properties from phys_prop module
79  };
80 
81  struct aerlist_t {
82  int numaerosols; // number of aerosols
83  std::string list_id;
84  std::vector<aerosol_t> aer; // dimension(numaerosols)
85  };
86 
87  // storage for modal aerosol components in the climate/diagnostic lists
88  struct modelist_t {
89  int nmodes; // number of modes
90  std::string list_id;
91  std::vector<int> idx; // index of the mode in the mode definition object
92  std::vector<std::string> physprop_files; // physprop filename
93  std::vector<int> idx_props; // index of the mode properties in the physprop object
94  };
95 
96  // gasses used in climate/diagnostic calculations
97  std::vector<gaslist_t> gaslist;
98 
99  // list of aerosols used in climate/diagnostic calcs
100  std::vector<aerlist_t> aerosollist;
101 
102  // list of aerosol modes used in climate/diagnostic calcs
103  std::vector<modelist_t> ma_list;
104 
105  // mode definitions
107 
108  // physics prop
110 
111  const int num_mode_types = 8;
112  const int num_spec_types = 8;
113  const std::vector<std::string> mode_type_names {"accum", "aitken", "primary_carbon", "fine_seasalt",
114  "fine_dust", "coarse", "coarse_seasalt", "coarse_dust"};
115 
116  const std::vector<std::string> spec_type_names {"sulfate", "ammonium", "nitrate", "p-organic",
117  "s-organic", "black-c", "seasalt", "dust"};
118  public:
119  // constructor
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  }
271 
272  // The initialization of the gas and aerosol lists is finished by
273  // 1) read the physprop files
274  // 2) find the index of each constituent in the constituent or physics buffer arrays
275  // 3) find the index of the aerosol constituents used to access its properties from the
276  // physprop module.
277  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  }
301 
302  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  }
313 
314  // Return pointer to mass mixing ratio for the gas from the specified
315  // climate or diagnostic list.
316  inline
317  void rad_cnst_get_gas (int list_idx, const std::string& gasname, real2d& mmr) const
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  }
349 
350  void get_nmodes (int list_idx, int& nmodes) const
351  {
352  auto m_list = ma_list[list_idx];
353  nmodes = m_list.nmodes;
354  }
355 
356  void get_ngas (int list_idx, int& ngas) const
357  {
358  auto g_list = gaslist[list_idx];
359  ngas = g_list.ngas;
360  }
361 
362  void get_naero (int list_idx, int& naero) const
363  {
364  auto a_list = aerosollist[list_idx];
365  naero = a_list.numaerosols;
366  }
367 
368  void get_gas_names (int list_idx, std::vector<std::string>& gasnames, bool& use_data_o3) const
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  }
384 
385  void get_aero_names (int list_idx, std::vector<std::string>& aernames) const
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  }
393 
394  void get_mode_nspec (int list_idx, int m_idx, int& nspec) const
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  }
402 
403  // Return info about modal aerosol list
404  void rad_cnst_get_info_by_mode (int list_idx, int m_idx,
405  std::string& mode_type, std::string& num_name,
406  std::string& num_name_cw, int& nspec) const
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  }
430 
431  // Return info about modal aerosol lists
432  void rad_cnst_get_info_by_mode_spec (int list_idx, int m_idx, int s_idx,
433  std::string& spec_type, std::string& spec_name,
434  std::string& spec_name_cw) const
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  }
460 
461  // Return info about modes in the specified climate/diagnostics list
462  void rad_cnst_get_info_by_spectype (int list_idx, const std::string& spectype,
463  int& mode_idx, int& spec_idx) const
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  }
497 
498  int rad_cnst_get_mode_idx (int list_idx, const std::string& mode_type) const
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  }
522 
523  int rad_cnst_get_spec_idx (int list_idx, int mode_idx,
524  const std::string& spec_type) const
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  }
551 
552  // Output the mass per layer, and total column burdens for gas and aerosol
553  // constituents in either the climate or diagnostic lists
554  void rad_cnst_out (int list_idx) const
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  }
612 
613  // Return pointer to mass mixing ratio for the aerosol from the specified
614  // climate or diagnostic list.
615  void rad_cnst_get_aer_mmr_by_idx (int list_idx, int aer_idx, real2d& mmr) const
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  }
636 
637  // Return pointer to mass mixing ratio for the modal aerosol specie from the specified
638  // climate or diagnostic list.
639  void rad_cnst_get_mam_mmr_by_idx (int list_idx, int mode_idx, int spec_idx,
640  const std::string& phase, real2d& mmr) const
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  }
682 
683  void rad_cnst_get_mam_mmr_idx (int mode_idx, int spec_idx, int& idx) const
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  }
708 
709  // Return pointer to number mixing ratio for the aerosol mode from the specified
710  // climate or diagnostic list.
711  void rad_cnst_get_mode_num (int list_idx, int mode_idx, const std::string& phase, real2d& num) const
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  }
745 
746  // Return constituent index of mode number mixing ratio for the aerosol mode in
747  // the climate list.
748 
749  // This is a special routine to allow direct access to information in the
750  // constituent array inside physics parameterizations that have been passed,
751  // and are operating over the entire constituent array. The interstitial phase
752  // is assumed since that's what is contained in the constituent array.
753  void rad_cnst_get_mode_num_idx (int mode_idx, int& cnst_idx) const
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  }
778 
779  // Return the index of aerosol aer_name in the list specified by list_idx.
780  int rad_cnst_get_aer_idx (int list_idx, std::string& aer_name) const
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  }
805 
806  // Return requested properties for the mode from the specified
807  // climate or diagnostic list.
808  void get_mode_props (int list_idx, int mode_idx, real& sigmag,
809  real& rhcrystal, real& rhdeliques) const
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  }
822 
823  void get_mode_props (int list_idx, int mode_idx, real& sigmag,
824  real2d& refrtablw, real2d& refitablw, real4d& absplw) const
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  }
838 
839  void get_mode_props (int list_idx, int mode_idx, real& sigmag, real2d& refrtabsw,
840  real2d& refitabsw, real4d& extpsw, real4d& abspsw, real4d& asmpsw) const
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  }
856 
857  void get_mode_props (int list_idx, int mode_idx, int& ncoef, int& prefr, int& prefi) const
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  }
870 
871  inline
872  void get_mode_props (int list_idx, int mode_idx, real& dgnum, real& dgnumhi,
873  real& dgnumlo, real& sigmag) const
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  }
887 
888  inline
889  void get_mam_density_aer (int list_idx, int mode_idx, int spec_idx,
890  real& density_aer) const
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  }
901 
902  inline
903  void get_mam_hygro_aer (int list_idx, int mode_idx, int spec_idx,
904  real& hygro_aer) const
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  }
915 
916  // Return requested properties for the aerosol from the specified
917  // climate or diagnostic list.
918  inline
919  void get_mam_props (int list_idx, int mode_idx, int spec_idx, real& density_aer,
920  std::string& spectype, real& hygro_aer,
921  real1d& refindex_real_aer_sw, real1d& refindex_im_aer_sw) const
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  }
937 
938  inline
939  void get_mam_props_sw (int list_idx, int mode_idx, int spec_idx,
940  real& density_aer, real1d& refindex_real_aer_sw,
941  real1d& refindex_im_aer_sw) const
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  }
955 
956  inline
957  void get_mam_props (int list_idx, int mode_idx, int spec_idx, real& density_aer) const
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  }
968 
969  inline
970  void get_mam_props_lw (int list_idx, int mode_idx, int spec_idx,
971  real& density_aer,
972  real1d& refindex_real_aer_lw,
973  real1d& refindex_im_aer_lw) const
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  }
987 
988  inline
989  void get_aer_opticstype (int list_idx, int aer_idx, std::string& opticstype) const
990  {
991  auto aerlist = aerosollist[list_idx];
992  auto id = aerlist.aer[aer_idx].physprop_id;
993 
994  prop.get_opticstype(id, opticstype);
995  }
996 
997  inline
998  void get_aer_sw_hygro_ext (int list_idx, int aer_idx, real2d& sw_hygro_ext) const
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  }
1005 
1006  inline
1007  void get_aer_sw_hygro_ssa (int list_idx, int aer_idx, real2d& sw_hygro_ssa) const
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  }
1014 
1015  inline
1016  void get_aer_sw_hygro_asm (int list_idx, int aer_idx, real2d& sw_hygro_asm) const
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  }
1023 
1024  inline
1025  void get_aer_lw_hygro_abs (int list_idx, int aer_idx, real2d& lw_hygro_abs) const
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  }
1032 
1033  inline
1034  void get_aer_sw_nonhygro_ext (int list_idx, int aer_idx, real1d& sw_nonhygro_ext) const
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  }
1041 
1042  inline
1043  void get_aer_sw_nonhygro_ssa (int list_idx, int aer_idx, real1d& sw_nonhygro_ssa) const
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  }
1050 
1051  inline
1052  void get_aer_sw_nonhygro_asm (int list_idx, int aer_idx, real1d& sw_nonhygro_asm) const
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  }
1059 
1060  inline
1061  void get_aer_sw_nonhygro_scat (int list_idx, int aer_idx, real1d& sw_nonhygro_scat) const
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  }
1068 
1069  inline
1070  void get_aer_sw_nonhygro_ascat (int list_idx, int aer_idx, real1d& sw_nonhygro_ascat) const
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  }
1077 
1078  inline
1079  void get_aer_lw_abs (int list_idx, int aer_idx, real1d& lw_abs) const
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  }
1086 
1087  inline
1088  void get_aer_refindex_aer_sw (int list_idx, int aer_idx,
1089  real1d& refindex_real_aer_sw,
1090  real1d& refindex_im_aer_sw) const
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  }
1098 
1099  inline
1100  void get_aer_refindex_aer_lw (int list_idx, int aer_idx,
1101  real1d& refindex_real_aer_lw,
1102  real1d& refindex_im_aer_lw) const
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  }
1110 
1111  inline
1112  void get_aer_r_sw_ext (int list_idx, int aer_idx, real2d& r_sw_ext) const
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  }
1119 
1120  inline
1121  void get_aer_r_sw_scat (int list_idx, int aer_idx, real2d& r_sw_scat) const
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  }
1128 
1129  inline
1130  void get_aer_r_sw_ascat (int list_idx, int aer_idx, real2d& r_sw_ascat) const
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  }
1137 
1138  inline
1139  void get_aer_r_lw_abs (int list_idx, int aer_idx, real2d& r_lw_abs) const
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  }
1146 
1147  inline
1148  void get_aer_mu (int list_idx, int aer_idx, real1d& mu) const
1149  {
1150  auto aerlist = aerosollist[list_idx];
1151  auto id = aerlist.aer[aer_idx].physprop_id;
1152 
1153  prop.get_mu(id, mu);
1154  }
1155 
1156  inline
1157  void get_aername (int list_idx, int aer_idx, std::string& aername) const
1158  {
1159  auto aerlist = aerosollist[list_idx];
1160  auto id = aerlist.aer[aer_idx].physprop_id;
1161 
1162  prop.get_aername(id, aername);
1163  }
1164 
1165  inline
1166  void get_density_aer (int list_idx, int aer_idx, real& density_aer) const
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  }
1173 
1174  inline
1175  void get_hygro_aer (int list_idx, int aer_idx, real& hygro_aer) const
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  }
1182 
1183  inline
1184  void get_dryrad_aer (int list_idx, int aer_idx, real& dryrad_aer) const
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  }
1191 
1192  inline
1193  void get_dispersion_aer (int list_idx, int aer_idx, real& dispersion_aer) const
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  }
1200 
1201  inline
1202  void get_num_to_mass_aer (int list_idx, int aer_idx, real& num_to_mass_aer) const
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  }
1209 };
1210 #endif
Definition: ERF_Mam4_constituents.H:18
void get_aer_r_sw_scat(int list_idx, int aer_idx, real2d &r_sw_scat) const
Definition: ERF_Mam4_constituents.H:1121
const int N_DIAG
Definition: ERF_Mam4_constituents.H:20
std::string liqcldoptics
Definition: ERF_Mam4_constituents.H:22
void get_aer_r_sw_ascat(int list_idx, int aer_idx, real2d &r_sw_ascat) const
Definition: ERF_Mam4_constituents.H:1130
void get_aer_lw_hygro_abs(int list_idx, int aer_idx, real2d &lw_hygro_abs) const
Definition: ERF_Mam4_constituents.H:1025
std::string iceopticsfile
Definition: ERF_Mam4_constituents.H:21
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
Definition: ERF_Mam4_constituents.H:404
void get_mode_props(int list_idx, int mode_idx, int &ncoef, int &prefr, int &prefi) const
Definition: ERF_Mam4_constituents.H:857
void rad_cnst_get_mode_num(int list_idx, int mode_idx, const std::string &phase, real2d &num) const
Definition: ERF_Mam4_constituents.H:711
void get_aer_sw_nonhygro_scat(int list_idx, int aer_idx, real1d &sw_nonhygro_scat) const
Definition: ERF_Mam4_constituents.H:1061
void rad_cnst_get_info_by_spectype(int list_idx, const std::string &spectype, int &mode_idx, int &spec_idx) const
Definition: ERF_Mam4_constituents.H:462
modes_t modes
Definition: ERF_Mam4_constituents.H:106
const int num_spec_types
Definition: ERF_Mam4_constituents.H:112
int rad_cnst_get_aer_idx(int list_idx, std::string &aer_name) const
Definition: ERF_Mam4_constituents.H:780
void get_num_to_mass_aer(int list_idx, int aer_idx, real &num_to_mass_aer) const
Definition: ERF_Mam4_constituents.H:1202
const std::vector< std::string > spec_type_names
Definition: ERF_Mam4_constituents.H:116
void get_aer_r_sw_ext(int list_idx, int aer_idx, real2d &r_sw_ext) const
Definition: ERF_Mam4_constituents.H:1112
void get_hygro_aer(int list_idx, int aer_idx, real &hygro_aer) const
Definition: ERF_Mam4_constituents.H:1175
void get_aer_lw_abs(int list_idx, int aer_idx, real1d &lw_abs) const
Definition: ERF_Mam4_constituents.H:1079
void get_mode_props(int list_idx, int mode_idx, real &sigmag, real2d &refrtabsw, real2d &refitabsw, real4d &extpsw, real4d &abspsw, real4d &asmpsw) const
Definition: ERF_Mam4_constituents.H:839
std::string icecldoptics
Definition: ERF_Mam4_constituents.H:22
void get_aername(int list_idx, int aer_idx, std::string &aername) const
Definition: ERF_Mam4_constituents.H:1157
void get_mode_nspec(int list_idx, int m_idx, int &nspec) const
Definition: ERF_Mam4_constituents.H:394
const int num_mode_types
Definition: ERF_Mam4_constituents.H:111
void get_aer_sw_nonhygro_ext(int list_idx, int aer_idx, real1d &sw_nonhygro_ext) const
Definition: ERF_Mam4_constituents.H:1034
void get_mode_props(int list_idx, int mode_idx, real &dgnum, real &dgnumhi, real &dgnumlo, real &sigmag) const
Definition: ERF_Mam4_constituents.H:872
const std::vector< std::string > mode_type_names
Definition: ERF_Mam4_constituents.H:113
void rad_cnst_init()
Definition: ERF_Mam4_constituents.H:278
MamConstituents()
Definition: ERF_Mam4_constituents.H:120
void get_gas_names(int list_idx, std::vector< std::string > &gasnames, bool &use_data_o3) const
Definition: ERF_Mam4_constituents.H:368
const int n_rad_cnst
Definition: ERF_Mam4_constituents.H:26
void rad_cnst_get_mode_num_idx(int mode_idx, int &cnst_idx) const
Definition: ERF_Mam4_constituents.H:753
void rad_cnst_out(int list_idx) const
Definition: ERF_Mam4_constituents.H:554
void get_aero_names(int list_idx, std::vector< std::string > &aernames) const
Definition: ERF_Mam4_constituents.H:385
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
Definition: ERF_Mam4_constituents.H:919
int rad_cnst_get_mode_idx(int list_idx, const std::string &mode_type) const
Definition: ERF_Mam4_constituents.H:498
void get_density_aer(int list_idx, int aer_idx, real &density_aer) const
Definition: ERF_Mam4_constituents.H:1166
void get_mam_props(int list_idx, int mode_idx, int spec_idx, real &density_aer) const
Definition: ERF_Mam4_constituents.H:957
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
Definition: ERF_Mam4_constituents.H:432
void get_aer_sw_nonhygro_asm(int list_idx, int aer_idx, real1d &sw_nonhygro_asm) const
Definition: ERF_Mam4_constituents.H:1052
void rad_cnst_get_mam_mmr_by_idx(int list_idx, int mode_idx, int spec_idx, const std::string &phase, real2d &mmr) const
Definition: ERF_Mam4_constituents.H:639
void get_dispersion_aer(int list_idx, int aer_idx, real &dispersion_aer) const
Definition: ERF_Mam4_constituents.H:1193
void get_aer_refindex_aer_lw(int list_idx, int aer_idx, real1d &refindex_real_aer_lw, real1d &refindex_im_aer_lw) const
Definition: ERF_Mam4_constituents.H:1100
void get_aer_sw_nonhygro_ascat(int list_idx, int aer_idx, real1d &sw_nonhygro_ascat) const
Definition: ERF_Mam4_constituents.H:1070
void get_ngas(int list_idx, int &ngas) const
Definition: ERF_Mam4_constituents.H:356
void rad_cnst_get_gas(int list_idx, const std::string &gasname, real2d &mmr) const
Definition: ERF_Mam4_constituents.H:317
void get_aer_sw_hygro_asm(int list_idx, int aer_idx, real2d &sw_hygro_asm) const
Definition: ERF_Mam4_constituents.H:1016
void get_aer_mu(int list_idx, int aer_idx, real1d &mu) const
Definition: ERF_Mam4_constituents.H:1148
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
Definition: ERF_Mam4_constituents.H:970
void get_mam_density_aer(int list_idx, int mode_idx, int spec_idx, real &density_aer) const
Definition: ERF_Mam4_constituents.H:889
void init_mode_comps()
Definition: ERF_Mam4_constituents.H:303
void get_aer_sw_hygro_ssa(int list_idx, int aer_idx, real2d &sw_hygro_ssa) const
Definition: ERF_Mam4_constituents.H:1007
void get_aer_sw_nonhygro_ssa(int list_idx, int aer_idx, real1d &sw_nonhygro_ssa) const
Definition: ERF_Mam4_constituents.H:1043
void get_nmodes(int list_idx, int &nmodes) const
Definition: ERF_Mam4_constituents.H:350
void get_aer_sw_hygro_ext(int list_idx, int aer_idx, real2d &sw_hygro_ext) const
Definition: ERF_Mam4_constituents.H:998
void rad_cnst_get_aer_mmr_by_idx(int list_idx, int aer_idx, real2d &mmr) const
Definition: ERF_Mam4_constituents.H:615
void get_aer_refindex_aer_sw(int list_idx, int aer_idx, real1d &refindex_real_aer_sw, real1d &refindex_im_aer_sw) const
Definition: ERF_Mam4_constituents.H:1088
std::vector< modelist_t > ma_list
Definition: ERF_Mam4_constituents.H:103
void get_dryrad_aer(int list_idx, int aer_idx, real &dryrad_aer) const
Definition: ERF_Mam4_constituents.H:1184
std::vector< gaslist_t > gaslist
Definition: ERF_Mam4_constituents.H:97
void get_aer_opticstype(int list_idx, int aer_idx, std::string &opticstype) const
Definition: ERF_Mam4_constituents.H:989
void get_aer_r_lw_abs(int list_idx, int aer_idx, real2d &r_lw_abs) const
Definition: ERF_Mam4_constituents.H:1139
std::vector< aerlist_t > aerosollist
Definition: ERF_Mam4_constituents.H:100
std::string liqopticsfile
Definition: ERF_Mam4_constituents.H:21
int rad_cnst_get_spec_idx(int list_idx, int mode_idx, const std::string &spec_type) const
Definition: ERF_Mam4_constituents.H:523
void rad_cnst_get_mam_mmr_idx(int mode_idx, int spec_idx, int &idx) const
Definition: ERF_Mam4_constituents.H:683
void get_mam_hygro_aer(int list_idx, int mode_idx, int spec_idx, real &hygro_aer) const
Definition: ERF_Mam4_constituents.H:903
const bool oldcldoptics
Definition: ERF_Mam4_constituents.H:23
void get_mode_props(int list_idx, int mode_idx, real &sigmag, real &rhcrystal, real &rhdeliques) const
Definition: ERF_Mam4_constituents.H:808
void get_mode_props(int list_idx, int mode_idx, real &sigmag, real2d &refrtablw, real2d &refitablw, real4d &absplw) const
Definition: ERF_Mam4_constituents.H:823
void get_naero(int list_idx, int &naero) const
Definition: ERF_Mam4_constituents.H:362
PhysProp prop
Definition: ERF_Mam4_constituents.H:109
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
Definition: ERF_Mam4_constituents.H:939
Definition: ERF_Phys_prop.H:17
void physprop_init()
Definition: ERF_Phys_prop.H:112
void get_sw_nonhygro_ssa(int &id, real1d &sw_nonhygro_ssa) const
Definition: ERF_Phys_prop.H:187
void get_r_sw_ext(int &id, real2d &r_sw_ext) const
Definition: ERF_Phys_prop.H:250
void get_sw_nonhygro_ext(int &id, real1d &sw_nonhygro_ext) const
Definition: ERF_Phys_prop.H:180
void get_ref_real_aer_sw(int &id, real1d &ref_real_aer_sw) const
Definition: ERF_Phys_prop.H:222
void get_sw_nonhygro_scat(int &id, real1d &sw_nonhygro_scat) const
Definition: ERF_Phys_prop.H:201
void get_prefr(int &id, int &prefr) const
Definition: ERF_Phys_prop.H:390
void get_ref_im_aer_sw(int &id, real1d &ref_im_aer_sw) const
Definition: ERF_Phys_prop.H:236
void get_lw_hygro_abs(int &id, real2d &lw_hygro_abs) const
Definition: ERF_Phys_prop.H:173
void get_sigmag(int &id, real &sigmag) const
Definition: ERF_Phys_prop.H:404
void get_dgnum(int &id, real &dgnum) const
Definition: ERF_Phys_prop.H:411
void get_r_lw_abs(int &id, real2d &r_lw_abs) const
Definition: ERF_Phys_prop.H:271
void get_refitablw(int &id, real2d &refitablw) const
Definition: ERF_Phys_prop.H:334
void get_ref_real_aer_lw(int &id, real1d &ref_real_aer_lw) const
Definition: ERF_Phys_prop.H:229
void get_hygro_aer(int &id, real &hygro_aer) const
Definition: ERF_Phys_prop.H:355
void get_mu(int &id, real1d &mu) const
Definition: ERF_Phys_prop.H:278
void get_sw_nonhygro_asm(int &id, real1d &sw_nonhygro_asm) const
Definition: ERF_Phys_prop.H:194
void get_abspsw(int &id, real4d &abspsw) const
Definition: ERF_Phys_prop.H:292
void get_opticstype(int &id, std::string &opticstype) const
Definition: ERF_Phys_prop.H:145
void get_extpsw(int &id, real4d &extpsw) const
Definition: ERF_Phys_prop.H:285
void get_aername(int &id, std::string &aername) const
Definition: ERF_Phys_prop.H:341
void get_ref_im_aer_lw(int &id, real1d &ref_im_aer_lw) const
Definition: ERF_Phys_prop.H:243
void physprop_accum_unique_files(const std::string &filename, const std::string &type)
Definition: ERF_Phys_prop.H:92
void get_sw_hygro_ssa(int &id, real2d &sw_hygro_ssa) const
Definition: ERF_Phys_prop.H:159
void get_ncoef(int &id, int &ncoef) const
Definition: ERF_Phys_prop.H:383
void get_sw_hygro_ext(int &id, real2d &sw_hygro_ext) const
Definition: ERF_Phys_prop.H:152
void get_refrtablw(int &id, real2d &refrtablw) const
Definition: ERF_Phys_prop.H:327
void get_r_sw_scat(int &id, real2d &r_sw_scat) const
Definition: ERF_Phys_prop.H:257
void get_sw_nonhygro_ascat(int &id, real1d &sw_nonhygro_ascat) const
Definition: ERF_Phys_prop.H:208
void get_dryrad_aer(int &id, real &dryrad_aer) const
Definition: ERF_Phys_prop.H:362
void get_dispersion_aer(int &id, real &dispersion_aer) const
Definition: ERF_Phys_prop.H:369
void get_refrtabsw(int &id, real2d &refrtabsw) const
Definition: ERF_Phys_prop.H:313
void get_asmpsw(int &id, real4d &asmpsw) const
Definition: ERF_Phys_prop.H:299
void get_rhdeliques(int &id, real &rhdeliques) const
Definition: ERF_Phys_prop.H:439
int physprop_get_id(std::string filename) const
Definition: ERF_Phys_prop.H:125
void get_num_to_mass_aer(int &id, real &num_to_mass_aer) const
Definition: ERF_Phys_prop.H:376
void get_refitabsw(int &id, real2d &refitabsw) const
Definition: ERF_Phys_prop.H:320
void get_density_aer(int &id, real &density_aer) const
Definition: ERF_Phys_prop.H:348
void get_absplw(int &id, real4d &absplw) const
Definition: ERF_Phys_prop.H:306
void get_r_sw_ascat(int &id, real2d &r_sw_ascat) const
Definition: ERF_Phys_prop.H:264
void get_rhcrystal(int &id, real &rhcrystal) const
Definition: ERF_Phys_prop.H:432
void get_prefi(int &id, int &prefi) const
Definition: ERF_Phys_prop.H:397
void get_sw_hygro_asm(int &id, real2d &sw_hygro_asm) const
Definition: ERF_Phys_prop.H:166
void get_dgnumlo(int &id, real &dgnumlo) const
Definition: ERF_Phys_prop.H:418
void get_lw_abs(int &id, real1d &lw_abs) const
Definition: ERF_Phys_prop.H:215
void get_dgnumhi(int &id, real &dgnumhi) const
Definition: ERF_Phys_prop.H:425
static int rad_gas_index(std::string gasname)
Definition: ERF_Rad_constants.H:255
Definition: ERF_Mam4_constituents.H:81
std::vector< aerosol_t > aer
Definition: ERF_Mam4_constituents.H:84
std::string list_id
Definition: ERF_Mam4_constituents.H:83
int numaerosols
Definition: ERF_Mam4_constituents.H:82
Definition: ERF_Mam4_constituents.H:72
std::string physprop_file
Definition: ERF_Mam4_constituents.H:75
std::string camname
Definition: ERF_Mam4_constituents.H:74
std::string mass_name
Definition: ERF_Mam4_constituents.H:76
int idx
Definition: ERF_Mam4_constituents.H:77
int physprop_id
Definition: ERF_Mam4_constituents.H:78
std::string source
Definition: ERF_Mam4_constituents.H:73
Definition: ERF_Mam4_constituents.H:58
std::string source
Definition: ERF_Mam4_constituents.H:59
int idx
Definition: ERF_Mam4_constituents.H:62
std::string camname
Definition: ERF_Mam4_constituents.H:60
std::string mass_name
Definition: ERF_Mam4_constituents.H:61
Definition: ERF_Mam4_constituents.H:65
std::string list_id
Definition: ERF_Mam4_constituents.H:67
int ngas
Definition: ERF_Mam4_constituents.H:66
std::vector< gas_t > gas
Definition: ERF_Mam4_constituents.H:68
Definition: ERF_Mam4_constituents.H:29
std::vector< std::string > source_mmr_a
Definition: ERF_Mam4_constituents.H:36
std::vector< int > idx_mmr_c
Definition: ERF_Mam4_constituents.H:45
int idx_num_a
Definition: ERF_Mam4_constituents.H:42
std::string source_num_c
Definition: ERF_Mam4_constituents.H:34
std::vector< std::string > camname_mmr_a
Definition: ERF_Mam4_constituents.H:37
std::vector< std::string > props
Definition: ERF_Mam4_constituents.H:41
std::vector< int > idx_mmr_a
Definition: ERF_Mam4_constituents.H:44
std::string camname_num_a
Definition: ERF_Mam4_constituents.H:33
std::vector< std::string > source_mmr_c
Definition: ERF_Mam4_constituents.H:38
std::string camname_num_c
Definition: ERF_Mam4_constituents.H:35
std::vector< int > idx_props
Definition: ERF_Mam4_constituents.H:46
std::vector< std::string > type
Definition: ERF_Mam4_constituents.H:40
int nspec
Definition: ERF_Mam4_constituents.H:30
std::vector< std::string > camname_mmr_c
Definition: ERF_Mam4_constituents.H:39
std::string source_num_a
Definition: ERF_Mam4_constituents.H:32
int idx_num_c
Definition: ERF_Mam4_constituents.H:43
Definition: ERF_Mam4_constituents.H:88
std::vector< int > idx_props
Definition: ERF_Mam4_constituents.H:93
std::vector< int > idx
Definition: ERF_Mam4_constituents.H:91
std::string list_id
Definition: ERF_Mam4_constituents.H:90
std::vector< std::string > physprop_files
Definition: ERF_Mam4_constituents.H:92
int nmodes
Definition: ERF_Mam4_constituents.H:89
Definition: ERF_Mam4_constituents.H:50
std::vector< mode_component_t > comps
Definition: ERF_Mam4_constituents.H:54
int nmodes
Definition: ERF_Mam4_constituents.H:51
std::vector< std::string > names
Definition: ERF_Mam4_constituents.H:52
std::vector< std::string > types
Definition: ERF_Mam4_constituents.H:53