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

#include <ERF_PhysProp.H>

Collaboration diagram for PhysProp:

Classes

struct  physprop_t
 

Public Member Functions

void physprop_accum_unique_files (const std::string &filename, const std::string &type)
 
void physprop_init ()
 
int physprop_get_id (std::string filename) const
 
void get_sourcefile (int &id, std::string &sourcefile) const
 
void get_opticstype (int &id, std::string &opticstype) const
 
void get_sw_hygro_ext (int &id, real2d &sw_hygro_ext) const
 
void get_sw_hygro_ssa (int &id, real2d &sw_hygro_ssa) const
 
void get_sw_hygro_asm (int &id, real2d &sw_hygro_asm) const
 
void get_lw_hygro_abs (int &id, real2d &lw_hygro_abs) const
 
void get_sw_nonhygro_ext (int &id, real1d &sw_nonhygro_ext) const
 
void get_sw_nonhygro_ssa (int &id, real1d &sw_nonhygro_ssa) const
 
void get_sw_nonhygro_asm (int &id, real1d &sw_nonhygro_asm) const
 
void get_sw_nonhygro_scat (int &id, real1d &sw_nonhygro_scat) const
 
void get_sw_nonhygro_ascat (int &id, real1d &sw_nonhygro_ascat) const
 
void get_lw_abs (int &id, real1d &lw_abs) const
 
void get_ref_real_aer_sw (int &id, real1d &ref_real_aer_sw) const
 
void get_ref_real_aer_lw (int &id, real1d &ref_real_aer_lw) const
 
void get_ref_im_aer_sw (int &id, real1d &ref_im_aer_sw) const
 
void get_ref_im_aer_lw (int &id, real1d &ref_im_aer_lw) const
 
void get_r_sw_ext (int &id, real2d &r_sw_ext) const
 
void get_r_sw_scat (int &id, real2d &r_sw_scat) const
 
void get_r_sw_ascat (int &id, real2d &r_sw_ascat) const
 
void get_r_lw_abs (int &id, real2d &r_lw_abs) const
 
void get_mu (int &id, real1d &mu) const
 
void get_extpsw (int &id, real4d &extpsw) const
 
void get_abspsw (int &id, real4d &abspsw) const
 
void get_asmpsw (int &id, real4d &asmpsw) const
 
void get_absplw (int &id, real4d &absplw) const
 
void get_refrtabsw (int &id, real2d &refrtabsw) const
 
void get_refitabsw (int &id, real2d &refitabsw) const
 
void get_refrtablw (int &id, real2d &refrtablw) const
 
void get_refitablw (int &id, real2d &refitablw) const
 
void get_aername (int &id, std::string &aername) const
 
void get_density_aer (int &id, real &density_aer) const
 
void get_hygro_aer (int &id, real &hygro_aer) const
 
void get_dryrad_aer (int &id, real &dryrad_aer) const
 
void get_dispersion_aer (int &id, real &dispersion_aer) const
 
void get_num_to_mass_aer (int &id, real &num_to_mass_aer) const
 
void get_ncoef (int &id, int &ncoef) const
 
void get_prefr (int &id, int &prefr) const
 
void get_prefi (int &id, int &prefi) const
 
void get_sigmag (int &id, real &sigmag) const
 
void get_dgnum (int &id, real &dgnum) const
 
void get_dgnumlo (int &id, real &dgnumlo) const
 
void get_dgnumhi (int &id, real &dgnumhi) const
 
void get_rhcrystal (int &id, real &rhcrystal) const
 
void get_rhdeliques (int &id, real &rhdeliques) const
 
void aerosol_optics_init (physprop_t &phys_prop)
 
void hygro_optics_init (physprop_t &phys_prop, yakl::SimpleNetCDF &prop)
 
void zero_optics_init (physprop_t &phys_prop, yakl::SimpleNetCDF &prop)
 
void insoluble_optics_init (physprop_t &phys_prop, yakl::SimpleNetCDF &prop)
 
void volcanic_radius_optics_init (physprop_t &phys_prop, yakl::SimpleNetCDF &prop)
 
void volcanic_optics_init (physprop_t &phys_prop, yakl::SimpleNetCDF &prop)
 
void hygroscopic_optics_init (physprop_t &phys_prop, yakl::SimpleNetCDF &prop)
 
void nonhygro_optics_init (physprop_t &phys_prop, yakl::SimpleNetCDF &prop)
 
void refindex_aer_init (physprop_t &phys_prop, yakl::SimpleNetCDF &prop)
 
void modal_optics_init (physprop_t &phys_prop, yakl::SimpleNetCDF &prop)
 
void bulk_props_init (physprop_t &phys_prop, yakl::SimpleNetCDF &prop)
 
real exp_interpol (const real1d &x, const real1d &f, const real &y)
 
real lin_interpol (const real1d &x, const real1d &f, const real &y)
 
void aer_optics_log_rh (std::string name, const real1d &ext, const real1d &ssa, const real1d &asmin)
 

Public Attributes

std::vector< physprop_tphysprop
 
std::vector< std::string > uniquefilenames
 

Member Function Documentation

◆ aer_optics_log_rh()

void PhysProp::aer_optics_log_rh ( std::string  name,
const real1d &  ext,
const real1d &  ssa,
const real1d &  asmin 
)
inline
837  {
838  const int nrh_test = 36;
839  //int krh;
840  real1d rh_test("rh_test", nrh_test);
841  //auto nrh = ext.extent(0);
842 
843  parallel_for (SimpleBounds<1> (nrh_test), YAKL_LAMBDA (int krh_test)
844  {
845  rh_test(krh_test) = sqrt(sqrt(sqrt(sqrt(((krh_test - 1.0) / (nrh_test - 1))))));
846  });
847 
848  // loop through test rh values
849  parallel_for (SimpleBounds<1> (nrh_test), YAKL_LAMBDA (int krh_test)
850  {
851  /*
852  // find corresponding rh index
853  auto rh = rh_test(krh_test);
854  auto krh = std::min(floor( (rh) * nrh ) + 1, static_cast<real>(nrh - 1));
855  auto wrh = (rh) *nrh - krh;
856  auto exti = ext(krh + 1) * (wrh + 1) - ext(krh) * wrh;
857  auto ssai = ssa(krh + 1) * (wrh + 1) - ssa(krh) * wrh;
858  auto asmi = asmin(krh + 1) * (wrh + 1) - asmin(krh) * wrh;
859  */
860  });
861  }

◆ aerosol_optics_init()

void PhysProp::aerosol_optics_init ( physprop_t phys_prop)
inline
449  {
450  using charHost1d = FArray<char,1,yakl::memHost>;
451  yakl::SimpleNetCDF prop;
452  prop.open(phys_prop.sourcefile, yakl::NETCDF_MODE_READ);
453  charHost1d temp;
454  prop.read(temp, "opticsmethod");
455  for (auto ichar = 1 ; ichar <= temp.extent(0); ichar++)
456  if (!isspace(temp(ichar))) phys_prop.opticsmethod += temp(ichar);
457 
458  if(strcmp(phys_prop.opticsmethod.c_str(),"zero") == 0) {
459  zero_optics_init(phys_prop, prop);
460  } else if (strcmp(phys_prop.opticsmethod.c_str(),"hygro") == 0) {
461  hygro_optics_init(phys_prop, prop);
462  } else if (strcmp(phys_prop.opticsmethod.c_str(),"hygroscopic") == 0) {
463  hygroscopic_optics_init(phys_prop, prop);
464  } else if (strcmp(phys_prop.opticsmethod.c_str(),"nonhygro") == 0) {
465  nonhygro_optics_init(phys_prop, prop);
466  } else if (strcmp(phys_prop.opticsmethod.c_str(),"insoluble") == 0) {
467  insoluble_optics_init(phys_prop, prop);
468  } else if (strcmp(phys_prop.opticsmethod.c_str(),"volcanic_radius") == 0) {
469  volcanic_radius_optics_init(phys_prop, prop);
470  } else if (strcmp(phys_prop.opticsmethod.c_str(),"volcanic") == 0) {
471  volcanic_optics_init(phys_prop, prop);
472  } else if (strcmp(phys_prop.opticsmethod.c_str(),"modal") == 0) {
473  modal_optics_init(phys_prop, prop);
474  } else {
475  amrex::Print() << "no options available\n";
476  }
477  }
void hygroscopic_optics_init(physprop_t &phys_prop, yakl::SimpleNetCDF &prop)
Definition: ERF_PhysProp.H:611
void volcanic_optics_init(physprop_t &phys_prop, yakl::SimpleNetCDF &prop)
Definition: ERF_PhysProp.H:596
void modal_optics_init(physprop_t &phys_prop, yakl::SimpleNetCDF &prop)
Definition: ERF_PhysProp.H:700
void hygro_optics_init(physprop_t &phys_prop, yakl::SimpleNetCDF &prop)
Definition: ERF_PhysProp.H:479
void insoluble_optics_init(physprop_t &phys_prop, yakl::SimpleNetCDF &prop)
Definition: ERF_PhysProp.H:543
void nonhygro_optics_init(physprop_t &phys_prop, yakl::SimpleNetCDF &prop)
Definition: ERF_PhysProp.H:672
void volcanic_radius_optics_init(physprop_t &phys_prop, yakl::SimpleNetCDF &prop)
Definition: ERF_PhysProp.H:579
void zero_optics_init(physprop_t &phys_prop, yakl::SimpleNetCDF &prop)
Definition: ERF_PhysProp.H:526

Referenced by physprop_init().

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

◆ bulk_props_init()

void PhysProp::bulk_props_init ( physprop_t phys_prop,
yakl::SimpleNetCDF &  prop 
)
inline
755  {
756  using charHost1d = FArray<char,1,yakl::memHost>;
757  charHost1d temp;
758  prop.read(temp, "name");
759  phys_prop.aername = "";
760  for (auto ichar = 1 ; ichar <= temp.extent(0); ichar++)
761  if (!isspace(temp(ichar))) phys_prop.aername += temp(ichar);
762 
763  // Read props for bulk aerosols
764  prop.read( phys_prop.density_aer, "density" );
765  prop.read( phys_prop.dispersion_aer, "sigma_logr" );
766  prop.read( phys_prop.dryrad_aer, "dryrad" );
767  prop.read( phys_prop.hygro_aer, "hygroscopicity" );
768  prop.read( phys_prop.num_to_mass_aer, "num_to_mass_ratio" );
769  }

Referenced by hygro_optics_init(), hygroscopic_optics_init(), insoluble_optics_init(), nonhygro_optics_init(), volcanic_optics_init(), and volcanic_radius_optics_init().

Here is the caller graph for this function:

◆ exp_interpol()

real PhysProp::exp_interpol ( const real1d &  x,
const real1d &  f,
const real &  y 
)
inline
778  {
779  auto n = x.extent(0);
780  int k;
781 
782  // find k such that x(k) < y =< x(k+1)
783  // set k = 1 if y <= x(1) and k = n-1 if y > x(n)
784  if (y <= x(1)) {
785  k = 1;
786  }
787  else if (y >= x(n)) {
788  k = n - 1;
789  }
790  else {
791  k = 1;
792  while (y > x(k+1) && k < n) {
793  k = k + 1;
794  }
795  }
796 
797  // interpolate
798  auto a = (log(f(k+1)/f(k)))/(x(k+1)-x(k));
799  return f(k)*exp(a*(y-x(k)));
800  }

Referenced by hygro_optics_init(), and hygroscopic_optics_init().

Here is the caller graph for this function:

◆ get_absplw()

void PhysProp::get_absplw ( int &  id,
real4d &  absplw 
) const
inline
307  {
308  if (id < 0 || id > physprop.size())
309  printf("get_absplw: illegal ID value %d\n", id);
310  absplw = physprop[id].absplw;
311  }
std::vector< physprop_t > physprop
Definition: ERF_PhysProp.H:83

Referenced by MamConstituents::get_mode_props().

Here is the caller graph for this function:

◆ get_abspsw()

void PhysProp::get_abspsw ( int &  id,
real4d &  abspsw 
) const
inline
293  {
294  if (id < 0 || id > physprop.size())
295  printf("get_abspsw: illegal ID value %d\n", id);
296  abspsw = physprop[id].abspsw;
297  }

Referenced by MamConstituents::get_mode_props().

Here is the caller graph for this function:

◆ get_aername()

void PhysProp::get_aername ( int &  id,
std::string &  aername 
) const
inline
342  {
343  if (id < 0 || id > physprop.size())
344  printf("get_aername: illegal ID value %d\n", id);
345  aername = physprop[id].aername;
346  }

Referenced by MamConstituents::get_aername().

Here is the caller graph for this function:

◆ get_asmpsw()

void PhysProp::get_asmpsw ( int &  id,
real4d &  asmpsw 
) const
inline
300  {
301  if (id < 0 || id > physprop.size())
302  printf("get_asmpsw: illegal ID value %d\n", id);
303  asmpsw = physprop[id].asmpsw;
304  }

Referenced by MamConstituents::get_mode_props().

Here is the caller graph for this function:

◆ get_density_aer()

void PhysProp::get_density_aer ( int &  id,
real &  density_aer 
) const
inline
349  {
350  if (id < 0 || id > physprop.size())
351  printf("get_density_aer: illegal ID value %d\n", id);
352  density_aer = physprop[id].density_aer;
353  }

Referenced by MamConstituents::get_density_aer(), MamConstituents::get_mam_density_aer(), MamConstituents::get_mam_props(), MamConstituents::get_mam_props_lw(), and MamConstituents::get_mam_props_sw().

Here is the caller graph for this function:

◆ get_dgnum()

void PhysProp::get_dgnum ( int &  id,
real &  dgnum 
) const
inline
412  {
413  if (id < 0 || id > physprop.size())
414  printf("get_dgnum: illegal ID value %d\n", id);
415  dgnum = physprop[id].dgnum;
416  }

Referenced by MamConstituents::get_mode_props().

Here is the caller graph for this function:

◆ get_dgnumhi()

void PhysProp::get_dgnumhi ( int &  id,
real &  dgnumhi 
) const
inline
426  {
427  if (id < 0 || id > physprop.size())
428  printf("get_dgnumhi: illegal ID value %d\n", id);
429  dgnumhi = physprop[id].dgnumhi;
430  }

Referenced by MamConstituents::get_mode_props().

Here is the caller graph for this function:

◆ get_dgnumlo()

void PhysProp::get_dgnumlo ( int &  id,
real &  dgnumlo 
) const
inline
419  {
420  if (id < 0 || id > physprop.size())
421  printf("get_dgnumlo: illegal ID value %d\n", id);
422  dgnumlo = physprop[id].dgnumlo;
423  }

Referenced by MamConstituents::get_mode_props().

Here is the caller graph for this function:

◆ get_dispersion_aer()

void PhysProp::get_dispersion_aer ( int &  id,
real &  dispersion_aer 
) const
inline
370  {
371  if (id < 0 || id > physprop.size())
372  printf("get_dispersion_aer: illegal ID value %d\n", id);
373  dispersion_aer = physprop[id].dispersion_aer;
374  }

Referenced by MamConstituents::get_dispersion_aer().

Here is the caller graph for this function:

◆ get_dryrad_aer()

void PhysProp::get_dryrad_aer ( int &  id,
real &  dryrad_aer 
) const
inline
363  {
364  if (id < 0 || id > physprop.size())
365  printf("get_dryrad_aer: illegal ID value %d\n", id);
366  dryrad_aer = physprop[id].dryrad_aer;
367  }

Referenced by MamConstituents::get_dryrad_aer().

Here is the caller graph for this function:

◆ get_extpsw()

void PhysProp::get_extpsw ( int &  id,
real4d &  extpsw 
) const
inline
286  {
287  if (id < 0 || id > physprop.size())
288  printf("get_expsw: illegal ID value %d\n", id);
289  extpsw = physprop[id].extpsw;
290  }

Referenced by MamConstituents::get_mode_props().

Here is the caller graph for this function:

◆ get_hygro_aer()

void PhysProp::get_hygro_aer ( int &  id,
real &  hygro_aer 
) const
inline
356  {
357  if (id < 0 || id > physprop.size())
358  printf("get_hygro_aer: illegal ID value %d\n", id);
359  hygro_aer = physprop[id].hygro_aer;
360  }

Referenced by MamConstituents::get_hygro_aer(), MamConstituents::get_mam_hygro_aer(), and MamConstituents::get_mam_props().

Here is the caller graph for this function:

◆ get_lw_abs()

void PhysProp::get_lw_abs ( int &  id,
real1d &  lw_abs 
) const
inline
216  {
217  if (id < 0 || id > physprop.size())
218  printf("get_lw_abs: illegal ID value %d\n", id);
219  lw_abs = physprop[id].lw_abs;
220  }

Referenced by MamConstituents::get_aer_lw_abs().

Here is the caller graph for this function:

◆ get_lw_hygro_abs()

void PhysProp::get_lw_hygro_abs ( int &  id,
real2d &  lw_hygro_abs 
) const
inline
174  {
175  if (id < 0 || id > physprop.size())
176  printf("get_lw_hygro_abs: illegal ID value %d\n", id);
177  lw_hygro_abs = physprop[id].lw_hygro_abs;
178  }

Referenced by MamConstituents::get_aer_lw_hygro_abs().

Here is the caller graph for this function:

◆ get_mu()

void PhysProp::get_mu ( int &  id,
real1d &  mu 
) const
inline
279  {
280  if (id < 0 || id > physprop.size())
281  printf("get_mu: illegal ID value %d\n", id);
282  mu = physprop[id].mu;
283  }

Referenced by MamConstituents::get_aer_mu().

Here is the caller graph for this function:

◆ get_ncoef()

void PhysProp::get_ncoef ( int &  id,
int &  ncoef 
) const
inline
384  {
385  if (id < 0 || id > physprop.size())
386  printf("get_ncoef: illegal ID value %d\n", id);
387  ncoef = physprop[id].ncoef;
388  }

Referenced by MamConstituents::get_mode_props().

Here is the caller graph for this function:

◆ get_num_to_mass_aer()

void PhysProp::get_num_to_mass_aer ( int &  id,
real &  num_to_mass_aer 
) const
inline
377  {
378  if (id < 0 || id > physprop.size())
379  printf("get_num_to_mass_aer: illegal ID value %d\n", id);
380  num_to_mass_aer = physprop[id].num_to_mass_aer;
381  }

Referenced by MamConstituents::get_num_to_mass_aer().

Here is the caller graph for this function:

◆ get_opticstype()

void PhysProp::get_opticstype ( int &  id,
std::string &  opticstype 
) const
inline
146  {
147  if (id < 0 || id > physprop.size())
148  printf("get_opticstype: illegal ID value %d\n", id);
149  opticstype = physprop[id].opticsmethod;
150  }

Referenced by MamConstituents::get_aer_opticstype().

Here is the caller graph for this function:

◆ get_prefi()

void PhysProp::get_prefi ( int &  id,
int &  prefi 
) const
inline
398  {
399  if (id < 0 || id > physprop.size())
400  printf("get_prefi: illegal ID value %d\n", id);
401  prefi = physprop[id].prefi;
402  }

Referenced by MamConstituents::get_mode_props().

Here is the caller graph for this function:

◆ get_prefr()

void PhysProp::get_prefr ( int &  id,
int &  prefr 
) const
inline
391  {
392  if (id < 0 || id > physprop.size())
393  printf("get_prefr: illegal ID value %d\n", id);
394  prefr = physprop[id].prefr;
395  }

Referenced by MamConstituents::get_mode_props().

Here is the caller graph for this function:

◆ get_r_lw_abs()

void PhysProp::get_r_lw_abs ( int &  id,
real2d &  r_lw_abs 
) const
inline
272  {
273  if (id < 0 || id > physprop.size())
274  printf("get_r_lw_abs: illegal ID value %d\n", id);
275  r_lw_abs = physprop[id].r_lw_abs;
276  }

Referenced by MamConstituents::get_aer_r_lw_abs().

Here is the caller graph for this function:

◆ get_r_sw_ascat()

void PhysProp::get_r_sw_ascat ( int &  id,
real2d &  r_sw_ascat 
) const
inline
265  {
266  if (id < 0 || id > physprop.size())
267  printf("get_r_sw_ascat: illegal ID value %d\n", id);
268  r_sw_ascat = physprop[id].r_sw_ascat;
269  }

Referenced by MamConstituents::get_aer_r_sw_ascat().

Here is the caller graph for this function:

◆ get_r_sw_ext()

void PhysProp::get_r_sw_ext ( int &  id,
real2d &  r_sw_ext 
) const
inline
251  {
252  if (id < 0 || id > physprop.size())
253  printf("get_r_sw_ext: illegal ID value %d\n", id);
254  r_sw_ext = physprop[id].r_sw_ext;
255  }

Referenced by MamConstituents::get_aer_r_sw_ext().

Here is the caller graph for this function:

◆ get_r_sw_scat()

void PhysProp::get_r_sw_scat ( int &  id,
real2d &  r_sw_scat 
) const
inline
258  {
259  if (id < 0 || id > physprop.size())
260  printf("get_r_sw_scat: illegal ID value %d\n", id);
261  r_sw_scat = physprop[id].r_sw_scat;
262  }

Referenced by MamConstituents::get_aer_r_sw_scat().

Here is the caller graph for this function:

◆ get_ref_im_aer_lw()

void PhysProp::get_ref_im_aer_lw ( int &  id,
real1d &  ref_im_aer_lw 
) const
inline
244  {
245  if (id < 0 || id > physprop.size())
246  printf("get_ref_im_aer_lw: illegal ID value %d\n", id);
247  ref_im_aer_lw = physprop[id].refindex_im_aer_lw;
248  }

Referenced by MamConstituents::get_aer_refindex_aer_lw(), and MamConstituents::get_mam_props_lw().

Here is the caller graph for this function:

◆ get_ref_im_aer_sw()

void PhysProp::get_ref_im_aer_sw ( int &  id,
real1d &  ref_im_aer_sw 
) const
inline
237  {
238  if (id < 0 || id > physprop.size())
239  printf("get_ref_im_aer_sw: illegal ID value %d\n", id);
240  ref_im_aer_sw = physprop[id].refindex_im_aer_sw;
241  }

Referenced by MamConstituents::get_aer_refindex_aer_sw(), MamConstituents::get_mam_props(), and MamConstituents::get_mam_props_sw().

Here is the caller graph for this function:

◆ get_ref_real_aer_lw()

void PhysProp::get_ref_real_aer_lw ( int &  id,
real1d &  ref_real_aer_lw 
) const
inline
230  {
231  if (id < 0 || id > physprop.size())
232  printf("get_ref_real_aer_lw: illegal ID value %d\n", id);
233  ref_real_aer_lw = physprop[id].refindex_real_aer_lw;
234  }

Referenced by MamConstituents::get_aer_refindex_aer_lw(), and MamConstituents::get_mam_props_lw().

Here is the caller graph for this function:

◆ get_ref_real_aer_sw()

void PhysProp::get_ref_real_aer_sw ( int &  id,
real1d &  ref_real_aer_sw 
) const
inline
223  {
224  if (id < 0 || id > physprop.size())
225  printf("get_ref_real_aer_sw: illegal ID value %d\n", id);
226  ref_real_aer_sw = physprop[id].refindex_real_aer_sw;
227  }

Referenced by MamConstituents::get_aer_refindex_aer_sw(), MamConstituents::get_mam_props(), and MamConstituents::get_mam_props_sw().

Here is the caller graph for this function:

◆ get_refitablw()

void PhysProp::get_refitablw ( int &  id,
real2d &  refitablw 
) const
inline
335  {
336  if (id < 0 || id > physprop.size())
337  printf("ger_refitablw: illegal ID value %d\n", id);
338  refitablw = physprop[id].refitablw;
339  }

Referenced by MamConstituents::get_mode_props().

Here is the caller graph for this function:

◆ get_refitabsw()

void PhysProp::get_refitabsw ( int &  id,
real2d &  refitabsw 
) const
inline
321  {
322  if (id < 0 || id > physprop.size())
323  printf("get_refitabsw: illegal ID value %d\n", id);
324  refitabsw = physprop[id].refitabsw;
325  }

Referenced by MamConstituents::get_mode_props().

Here is the caller graph for this function:

◆ get_refrtablw()

void PhysProp::get_refrtablw ( int &  id,
real2d &  refrtablw 
) const
inline
328  {
329  if (id < 0 || id > physprop.size())
330  printf("get_refrtablw: illegal ID value %d\n", id);
331  refrtablw = physprop[id].refrtablw;
332  }

Referenced by MamConstituents::get_mode_props().

Here is the caller graph for this function:

◆ get_refrtabsw()

void PhysProp::get_refrtabsw ( int &  id,
real2d &  refrtabsw 
) const
inline
314  {
315  if (id < 0 || id > physprop.size())
316  printf("get_refrtabsw: illegal ID value %d\n", id);
317  refrtabsw = physprop[id].refrtabsw;
318  }

Referenced by MamConstituents::get_mode_props().

Here is the caller graph for this function:

◆ get_rhcrystal()

void PhysProp::get_rhcrystal ( int &  id,
real &  rhcrystal 
) const
inline
433  {
434  if (id < 0 || id > physprop.size())
435  printf("get_rhcrystal: illegal ID value %d\n", id);
436  rhcrystal = physprop[id].rhcrystal;
437  }

Referenced by MamConstituents::get_mode_props().

Here is the caller graph for this function:

◆ get_rhdeliques()

void PhysProp::get_rhdeliques ( int &  id,
real &  rhdeliques 
) const
inline
440  {
441  if (id < 0 || id > physprop.size())
442  printf("get_rhdeliques: illegal ID value %d\n", id);
443  rhdeliques = physprop[id].rhdeliques;
444  }

Referenced by MamConstituents::get_mode_props().

Here is the caller graph for this function:

◆ get_sigmag()

void PhysProp::get_sigmag ( int &  id,
real &  sigmag 
) const
inline
405  {
406  if (id < 0 || id > physprop.size())
407  printf("get_sigmag: illegal ID value %d\n", id);
408  sigmag = physprop[id].sigmag;
409  }

Referenced by MamConstituents::get_mode_props().

Here is the caller graph for this function:

◆ get_sourcefile()

void PhysProp::get_sourcefile ( int &  id,
std::string &  sourcefile 
) const
inline
139  {
140  if (id < 0 || id > physprop.size())
141  printf("get_sourcefile: illegal ID value %d\n", id);
142  sourcefile = physprop[id].sourcefile;
143  }

◆ get_sw_hygro_asm()

void PhysProp::get_sw_hygro_asm ( int &  id,
real2d &  sw_hygro_asm 
) const
inline
167  {
168  if (id < 0 || id > physprop.size())
169  printf("get_sw_hygro_asm: illegal ID value %d\n", id);
170  sw_hygro_asm = physprop[id].sw_hygro_asm;
171  }

Referenced by MamConstituents::get_aer_sw_hygro_asm().

Here is the caller graph for this function:

◆ get_sw_hygro_ext()

void PhysProp::get_sw_hygro_ext ( int &  id,
real2d &  sw_hygro_ext 
) const
inline
153  {
154  if (id < 0 || id > physprop.size())
155  printf("get_sw_hygro_ext: illegal ID value %d\n", id);
156  sw_hygro_ext = physprop[id].sw_hygro_ext;
157  }

Referenced by MamConstituents::get_aer_sw_hygro_ext().

Here is the caller graph for this function:

◆ get_sw_hygro_ssa()

void PhysProp::get_sw_hygro_ssa ( int &  id,
real2d &  sw_hygro_ssa 
) const
inline
160  {
161  if (id < 0 || id > physprop.size())
162  printf("get_sw_hygro_ssa: illegal ID value %d\n", id);
163  sw_hygro_ssa = physprop[id].sw_hygro_ssa;
164  }

Referenced by MamConstituents::get_aer_sw_hygro_ssa().

Here is the caller graph for this function:

◆ get_sw_nonhygro_ascat()

void PhysProp::get_sw_nonhygro_ascat ( int &  id,
real1d &  sw_nonhygro_ascat 
) const
inline
209  {
210  if (id < 0 || id > physprop.size())
211  printf("get_sw_nonhygro_ascat: illegal ID value %d\n", id);
212  sw_nonhygro_ascat = physprop[id].sw_nonhygro_ascat;
213  }

Referenced by MamConstituents::get_aer_sw_nonhygro_ascat().

Here is the caller graph for this function:

◆ get_sw_nonhygro_asm()

void PhysProp::get_sw_nonhygro_asm ( int &  id,
real1d &  sw_nonhygro_asm 
) const
inline
195  {
196  if (id < 0 || id > physprop.size())
197  printf("get_sw_nonhygro_asm: illegal ID value %d\n", id);
198  sw_nonhygro_asm = physprop[id].sw_nonhygro_asm;
199  }

Referenced by MamConstituents::get_aer_sw_nonhygro_asm().

Here is the caller graph for this function:

◆ get_sw_nonhygro_ext()

void PhysProp::get_sw_nonhygro_ext ( int &  id,
real1d &  sw_nonhygro_ext 
) const
inline
181  {
182  if (id < 0 || id > physprop.size())
183  printf("get_sw_nonhygro_ext: illegal ID value %d\n", id);
184  sw_nonhygro_ext = physprop[id].sw_nonhygro_ext;
185  }

Referenced by MamConstituents::get_aer_sw_nonhygro_ext().

Here is the caller graph for this function:

◆ get_sw_nonhygro_scat()

void PhysProp::get_sw_nonhygro_scat ( int &  id,
real1d &  sw_nonhygro_scat 
) const
inline
202  {
203  if (id < 0 || id > physprop.size())
204  printf("get_sw_nonhygro_scat: illegal ID value %d\n", id);
205  sw_nonhygro_scat = physprop[id].sw_nonhygro_scat;
206  }

Referenced by MamConstituents::get_aer_sw_nonhygro_scat().

Here is the caller graph for this function:

◆ get_sw_nonhygro_ssa()

void PhysProp::get_sw_nonhygro_ssa ( int &  id,
real1d &  sw_nonhygro_ssa 
) const
inline
188  {
189  if (id < 0 || id > physprop.size())
190  printf("get_sw_nonhygro_ssa: illegal ID value %d\n", id);
191  sw_nonhygro_ssa = physprop[id].sw_nonhygro_ssa;
192  }

Referenced by MamConstituents::get_aer_sw_nonhygro_ssa().

Here is the caller graph for this function:

◆ hygro_optics_init()

void PhysProp::hygro_optics_init ( physprop_t phys_prop,
yakl::SimpleNetCDF &  prop 
)
inline
480  {
481  real1d frh;
482  real2d fsw_ext;
483  real2d fsw_ssa;
484  real2d fsw_asm;
485  real2d flw_abs;
486 
487  auto nrh = RadConstants::nrh;
488  //auto nbnd = prop.getDimSize( "lw_band" );
489  auto nswbands = prop.getDimSize( "sw_band" );
490 
491  prop.read( fsw_ext, "ext_sw");
492  prop.read( fsw_ssa, "ssa_sw");
493  prop.read( fsw_asm, "asm_sw");
494  prop.read( flw_abs, "abs_lw");
495  prop.read( frh, "rh");
496 
497  real1d fswe("fswe",nrh),
498  fsws("fsws",nrh),
499  fswa("fswa",nrh);
500 
501  // interpolate onto cam's rh mesh
502  for(auto kbnd = 0; kbnd < nswbands; ++kbnd) {
503  for(auto krh = 0; krh < nrh; ++krh) {
504  fswe(krh) = fsw_ext(krh,kbnd)/fsw_ext(1,kbnd);
505  fsws(krh) = fsw_ssa(krh,kbnd)/fsw_ssa(1,kbnd);
506  fswa(krh) = fsw_asm(krh,kbnd)/fsw_asm(1,kbnd);
507  }
508 
509  // interpolation
510  for(auto krh = 0; krh < nrh; ++krh) {
511  auto rh = 1.0/nrh*(krh-1);
512  phys_prop.sw_hygro_ext(krh,kbnd) = exp_interpol(frh,fswe,rh)*fsw_ext(1,kbnd);
513  phys_prop.sw_hygro_ssa(krh,kbnd) = lin_interpol(frh,fsws,rh)*fsw_ssa(1,kbnd);
514  phys_prop.sw_hygro_asm(krh,kbnd) = lin_interpol(frh,fswa,rh)*fsw_asm(1,kbnd);
515  }
516  }
517 
518  // read refractive index data if available
519  refindex_aer_init(phys_prop, prop);
520 
521  // read bulk aero props
522  bulk_props_init(phys_prop, prop);
523  }
void refindex_aer_init(physprop_t &phys_prop, yakl::SimpleNetCDF &prop)
Definition: ERF_PhysProp.H:690
void bulk_props_init(physprop_t &phys_prop, yakl::SimpleNetCDF &prop)
Definition: ERF_PhysProp.H:754
real lin_interpol(const real1d &x, const real1d &f, const real &y)
Definition: ERF_PhysProp.H:809
real exp_interpol(const real1d &x, const real1d &f, const real &y)
Definition: ERF_PhysProp.H:777
static constexpr int nrh
Definition: ERF_RadConstants.H:77

Referenced by aerosol_optics_init().

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

◆ hygroscopic_optics_init()

void PhysProp::hygroscopic_optics_init ( physprop_t phys_prop,
yakl::SimpleNetCDF &  prop 
)
inline
612  {
613  // temp data from hygroscopic file before interpolation onto cam-rh-mesh
614  //int nfilerh; // number of rh values in file
615  real1d frh;
616  real2d fsw_ext, fsw_ssa, fsw_asm, flw_abs;
617 
618  auto nrh = RadConstants::nrh;
619  auto nlwbands = prop.getDimSize( "lw_band" );
620  auto nswbands = prop.getDimSize( "sw_band" );
621 
622  phys_prop.sw_hygro_ext = real2d("sw_hygro_ext",nrh,nswbands);
623  phys_prop.sw_hygro_ssa = real2d("sw_hygro_ssa",nrh,nswbands);
624  phys_prop.sw_hygro_asm = real2d("sw_hygro_asm",nrh,nswbands);
625  phys_prop.lw_hygro_abs = real2d("lw_hygro_abs",nrh,nlwbands);
626 
627  prop.read( fsw_ext, "ext_sw");
628  prop.read( fsw_ssa, "ssa_sw");
629  prop.read( fsw_asm, "asm_sw");
630  prop.read( flw_abs, "abs_lw");
631  prop.read( frh, "rh");
632 
633  real1d fswe("",nrh), fsws("",nrh),
634  fswa("",nrh), flwa("",nrh);
635 
636  // interpolate onto cam's rh mesh
637  parallel_for (SimpleBounds<2> (nswbands, nrh), YAKL_LAMBDA (int kbnd, int krh)
638  {
639  fswe(krh) = fsw_ext(krh,kbnd) / fsw_ext(1,kbnd);
640  fsws(krh) = fsw_ssa(krh,kbnd) / fsw_ssa(1,kbnd);
641  fswa(krh) = fsw_asm(krh,kbnd) / fsw_asm(1,kbnd);
642  });
643 
644  parallel_for (SimpleBounds<2> (nswbands, nrh), YAKL_LAMBDA (int kbnd, int krh)
645  {
646  auto rh = 1.0 / nrh * (krh - 1);
647  phys_prop.sw_hygro_ext(krh,kbnd) = exp_interpol( frh, fswe, rh ) * fsw_ext(1, kbnd);
648  phys_prop.sw_hygro_ssa(krh,kbnd) = lin_interpol( frh, fswe, rh ) * fsw_ssa(1, kbnd);
649  phys_prop.sw_hygro_asm(krh,kbnd) = lin_interpol( frh, fswa, rh ) * fsw_asm(1, kbnd);
650  });
651 
652  // interpolate long wave
653  parallel_for (SimpleBounds<2> (nlwbands, nrh), YAKL_LAMBDA (int kbnd, int krh)
654  {
655  flwa(krh) = flw_abs(krh,kbnd) / flw_abs(1,kbnd);
656  });
657 
658  parallel_for (SimpleBounds<2> (nlwbands, nrh), YAKL_LAMBDA (int kbnd, int krh)
659  {
660  auto rh = 1.0 / nrh * (krh - 1);
661  phys_prop.lw_hygro_abs(krh,kbnd) = exp_interpol( frh, flwa, rh ) * flw_abs(1, kbnd);
662  });
663 
664  // read refractive index data if available
665  refindex_aer_init(phys_prop, prop);
666 
667  // bulk aero props
668  bulk_props_init(phys_prop, prop);
669  }

Referenced by aerosol_optics_init().

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

◆ insoluble_optics_init()

void PhysProp::insoluble_optics_init ( physprop_t phys_prop,
yakl::SimpleNetCDF &  prop 
)
inline
544  {
545  auto nbnd = prop.getDimSize( "lw_band" );
546  auto nswbands = prop.getDimSize( "sw_band" );
547  realHost2d ext_sw, ssa_sw, asm_sw, abs_lw;
548 
549  phys_prop.sw_nonhygro_ext = real1d("sw_nonhygro_ext", nswbands);
550  phys_prop.sw_nonhygro_ssa = real1d("sw_nonhygro_ssa", nswbands);
551  phys_prop.sw_nonhygro_asm = real1d("sw_nonhygro_asm", nswbands);
552  phys_prop.lw_abs = real1d("lw_abs", nbnd);
553 
554  prop.read( ext_sw, "ext_sw");
555  prop.read( ssa_sw, "ssa_sw");
556  prop.read( asm_sw, "asm_sw");
557  prop.read( abs_lw, "abs_lw");
558 
559  parallel_for (SimpleBounds<1>(nswbands), YAKL_LAMBDA (int i)
560  {
561  phys_prop.sw_nonhygro_ext(i) = ext_sw(i,1);
562  phys_prop.sw_nonhygro_ssa(i) = ssa_sw(i,1);
563  phys_prop.sw_nonhygro_asm(i) = asm_sw(i,1);
564  });
565 
566  parallel_for (SimpleBounds<1>(nbnd), YAKL_LAMBDA (int i)
567  {
568  phys_prop.lw_abs(i) = abs_lw(i,1);
569  });
570 
571  // read refractive index data if available
572  refindex_aer_init(phys_prop, prop);
573 
574  // read bulk aero props
575  bulk_props_init(phys_prop, prop);
576  }

Referenced by aerosol_optics_init().

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

◆ lin_interpol()

real PhysProp::lin_interpol ( const real1d &  x,
const real1d &  f,
const real &  y 
)
inline
810  {
811  auto n = x.extent(0);
812  int k;
813  // find k such that x(k) < y =< x(k+1)
814  // set k = 1 if y <= x(1) and k = n-1 if y > x(n)
815  if (y <= x(1)) {
816  k = 1;
817  }
818  else if (y >= x(n)) {
819  k = n - 1;
820  }
821  else {
822  k = 1;
823  while (y > x(k+1) && k < n) {
824  k = k + 1;
825  }
826  }
827  // interpolate
828  auto a = (f(k+1)-f(k))/(x(k+1)-x(k));
829  return f(k)+a*(y-x(k));
830  }

Referenced by hygro_optics_init(), and hygroscopic_optics_init().

Here is the caller graph for this function:

◆ modal_optics_init()

void PhysProp::modal_optics_init ( physprop_t phys_prop,
yakl::SimpleNetCDF &  prop 
)
inline
701  {
702  // NOTE: Definitions for real arrays come from rrtmgp_const.h
703  // and they default to styleFortran ordering.
704  realHost5d extpsw, abspsw, asmpsw, absplw;
705  auto nlwbnd = prop.getDimSize( "lw_band" );
706  auto nswbnd = prop.getDimSize( "sw_band" );
707  auto ncoef = prop.getDimSize( "coef_number" );
708  auto prefr = prop.getDimSize( "refindex_real" );
709  auto prefi = prop.getDimSize( "refindex_im" );
710  phys_prop.ncoef = ncoef;
711  phys_prop.prefr = prefr;
712  phys_prop.prefi = prefi;
713 
714  prop.read(extpsw, "extpsw" );
715  prop.read(abspsw, "abspsw" );
716  prop.read(asmpsw, "asmpsw" );
717  prop.read(absplw, "absplw" );
718 
719  // styleFortran ordering to be consistent with realHost5d definition
720  phys_prop.extpsw = real4d("extpsw", ncoef, prefr, prefi, nswbnd);
721  phys_prop.abspsw = real4d("abspsw", ncoef, prefr, prefi, nswbnd);
722  phys_prop.asmpsw = real4d("asmpsw", ncoef, prefr, prefi, nswbnd);
723  phys_prop.absplw = real4d("absplw", ncoef, prefr, prefi, nswbnd);
724 
725  parallel_for (SimpleBounds<4>(nswbnd, prefr, prefi, ncoef),
726  YAKL_LAMBDA (int i, int j, int k, int l)
727  {
728  phys_prop.extpsw(i,j,k,l) = extpsw(i,j,k,1,l);
729  phys_prop.abspsw(i,j,k,l) = abspsw(i,j,k,1,l);
730  phys_prop.asmpsw(i,j,k,l) = asmpsw(i,j,k,1,l);
731  });
732 
733  parallel_for (SimpleBounds<4>(nlwbnd, prefr, prefi, ncoef),
734  YAKL_LAMBDA (int i, int j, int k, int l)
735  {
736  phys_prop.absplw(i,j,k,l) = absplw(i,j,k,1,l);
737  });
738 
739  prop.read(phys_prop.refrtabsw, "refindex_real_sw" );
740  prop.read(phys_prop.refitabsw, "refindex_im_sw" );
741  prop.read(phys_prop.refrtablw, "refindex_real_lw" );
742  prop.read(phys_prop.refitablw, "refindex_im_lw" );
743 
744  prop.read(phys_prop.sigmag, "sigmag" );
745  prop.read(phys_prop.dgnum, "dgnum" );
746 
747  prop.read(phys_prop.dgnumlo, "dgnumlo" );
748  prop.read(phys_prop.dgnumhi, "dgnumhi" );
749 
750  prop.read(phys_prop.rhcrystal, "rhcrystal" );
751  prop.read(phys_prop.rhdeliques, "rhdeliques" );
752  }

Referenced by aerosol_optics_init().

Here is the caller graph for this function:

◆ nonhygro_optics_init()

void PhysProp::nonhygro_optics_init ( physprop_t phys_prop,
yakl::SimpleNetCDF &  prop 
)
inline
673  {
674  //auto nlwbands = prop.getDimSize( "lw_band" );
675  //auto nswbands = prop.getDimSize( "sw_band" );
676 
677  prop.read( phys_prop.sw_nonhygro_ext, "ext_sw");
678  prop.read( phys_prop.sw_nonhygro_ssa, "ssa_sw");
679  prop.read( phys_prop.sw_nonhygro_asm, "asm_sw");
680  prop.read( phys_prop.lw_abs, "abs_lw");
681 
682  // read refractive index data if available
683  refindex_aer_init(phys_prop, prop);
684 
685  // read bulk aero props
686  bulk_props_init(phys_prop, prop);
687  }

Referenced by aerosol_optics_init().

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

◆ physprop_accum_unique_files()

void PhysProp::physprop_accum_unique_files ( const std::string &  filename,
const std::string &  type 
)
inline
94  {
95  // Count number of aerosols in input radname array. Aerosols are identified
96  // as strings with a ".nc" suffix.
97  // Construct a cumulative list of unique filenames containing physical property data.
98 
99  // check if filename is either a bulk aerosol or a mode
100  if (type == "A" || type == "M") {
101  // check if this filename has been used by another aerosol. If not
102  // then add it to the list of unique names.
103  if (physprop_get_id(filename) < 0)
104  uniquefilenames.push_back(filename);
105  }
106  }
std::vector< std::string > uniquefilenames
Definition: ERF_PhysProp.H:89
int physprop_get_id(std::string filename) const
Definition: ERF_PhysProp.H:125

Referenced by MamConstituents::MamConstituents().

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

◆ physprop_get_id()

int PhysProp::physprop_get_id ( std::string  filename) const
inline
126  {
127  auto physprop_id = -1;
128  auto numphysprops = uniquefilenames.size();
129  for(auto iphysprop = 0; iphysprop < numphysprops; ++iphysprop) {
130  if(uniquefilenames[iphysprop] == filename) {
131  physprop_id = iphysprop;
132  break;
133  }
134  }
135  return physprop_id;
136  }

Referenced by MamConstituents::init_mode_comps(), physprop_accum_unique_files(), and MamConstituents::rad_cnst_init().

Here is the caller graph for this function:

◆ physprop_init()

void PhysProp::physprop_init ( )
inline
113  {
114  int numphysprops = uniquefilenames.size();
115  physprop.resize(numphysprops);
116 
117  for(auto fileindex = 0; fileindex < numphysprops; ++fileindex) {
118  physprop[fileindex].sourcefile = uniquefilenames[fileindex];
119  aerosol_optics_init(physprop[fileindex]);
120  }
121  }
void aerosol_optics_init(physprop_t &phys_prop)
Definition: ERF_PhysProp.H:448

Referenced by MamConstituents::rad_cnst_init().

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

◆ refindex_aer_init()

void PhysProp::refindex_aer_init ( physprop_t phys_prop,
yakl::SimpleNetCDF &  prop 
)
inline
691  {
692  prop.read(phys_prop.refindex_real_aer_sw, "refindex_real_aer_sw");
693  prop.read(phys_prop.refindex_im_aer_sw, "refindex_im_aer_sw");
694 
695  prop.read(phys_prop.refindex_real_aer_lw, "refindex_real_aer_lw");
696  prop.read(phys_prop.refindex_im_aer_lw, "refindex_im_aer_lw");
697  }

Referenced by hygro_optics_init(), hygroscopic_optics_init(), insoluble_optics_init(), and nonhygro_optics_init().

Here is the caller graph for this function:

◆ volcanic_optics_init()

void PhysProp::volcanic_optics_init ( physprop_t phys_prop,
yakl::SimpleNetCDF &  prop 
)
inline
597  {
598  //auto nbnd = prop.getDimSize( "lw_band" );
599  //auto nswbands = prop.getDimSize( "sw_band" );
600 
601  prop.read( phys_prop.sw_nonhygro_ext, "bext_sw");
602  prop.read( phys_prop.sw_nonhygro_scat, "bsca_sw");
603  prop.read( phys_prop.sw_nonhygro_ascat, "basc_sw");
604  prop.read( phys_prop.lw_abs, "babs_lw");
605 
606  // read bulk aero props
607  bulk_props_init(phys_prop, prop);
608  }

Referenced by aerosol_optics_init().

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

◆ volcanic_radius_optics_init()

void PhysProp::volcanic_radius_optics_init ( physprop_t phys_prop,
yakl::SimpleNetCDF &  prop 
)
inline
580  {
581  //auto n_mu_samples = prop.getDimSize( "mu_samples" );
582  //auto nbnd = prop.getDimSize( "lw_band" );
583  //auto nswbands = prop.getDimSize( "sw_band" );
584 
585  prop.read( phys_prop.r_sw_ext, "bext_sw");
586  prop.read( phys_prop.r_sw_scat, "bsca_sw");
587  prop.read( phys_prop.r_sw_ascat, "basc_sw");
588  prop.read( phys_prop.r_lw_abs, "babs_lw");
589  prop.read( phys_prop.mu, "mu_samples");
590 
591  // read bulk aero props
592  bulk_props_init(phys_prop, prop);
593  }

Referenced by aerosol_optics_init().

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

◆ zero_optics_init()

void PhysProp::zero_optics_init ( physprop_t phys_prop,
yakl::SimpleNetCDF &  prop 
)
inline
527  {
528  auto nlwbands = prop.getDimSize( "lw_band" );
529  auto nswbands = prop.getDimSize( "sw_band" );
530 
531  // perhaps this doesn't even need allocated.
532  phys_prop.sw_nonhygro_ext = real1d("sw_nonhygro_ext", nswbands);
533  phys_prop.sw_nonhygro_ssa = real1d("sw_nonhygro_ssa", nswbands);
534  phys_prop.sw_nonhygro_asm = real1d("sw_nonhygro_asm", nswbands);
535  phys_prop.lw_abs = real1d("lwabs", nlwbands);
536 
537  yakl::memset(phys_prop.sw_nonhygro_ext, 0.);
538  yakl::memset(phys_prop.sw_nonhygro_ssa, 0.);
539  yakl::memset(phys_prop.sw_nonhygro_asm, 0.);
540  yakl::memset(phys_prop.lw_abs, 0.);
541  }

Referenced by aerosol_optics_init().

Here is the caller graph for this function:

Member Data Documentation

◆ physprop

◆ uniquefilenames

std::vector<std::string> PhysProp::uniquefilenames

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