ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_Optics.H
Go to the documentation of this file.
1 /*
2  * Optics class stores shortwave and longwave cloud optical properties *by band*.
3  * Dimensions are nswbands,ncol,nlev. Generally, this should be able to handle cases
4  * were ncol might be something like nday, and nlev could be arbitrary so long as
5  * corresponding fields were defined for all indices of nlev.
6  */
7 #ifndef ERF_OPTICS_H
8 #define ERF_OPTICS_H
9 
10 #include <string>
11 #include <vector>
12 #include <memory>
13 
14 #include <AMReX_FArrayBox.H>
15 #include <AMReX_Geometry.H>
16 #include <AMReX_TableData.H>
17 #include <AMReX_MultiFabUtil.H>
18 
19 #include "ERF_Constants.H"
20 #include "ERF_AeroRadProps.H"
21 #include "ERF_CloudRadProps.H"
22 
23 // Radiation code interface class
24 class Optics {
25  public:
26  // constructor
27  Optics () = default;
28  explicit Optics(int ngases, char* gas_names[]);
29  // deconstructor
30  ~Optics () = default;
31 
32  // get short wave cloud optics property
33  void get_cloud_optics_sw (int ncol, int nlev, int nbnd,
34  bool do_snow, const real2d& cld, const real2d& cldfsnow, const real2d& iclwp,
35  const real2d& iciwp, const real2d& icswp, const real2d& lambdac, const real2d& mu,
36  const real2d& dei, const real2d& des, const real2d& rel, const real2d& rei,
37  const real3d& tau_out, const real3d& ssa_out, const real3d& asm_out,
38  const real3d& liq_tau_out, const real3d& ice_tau_out, const real3d& snw_tau_out);
39 
40  // get long wave cloud optics property
41  void get_cloud_optics_lw (int ncol, int nlev, int nbnd, bool do_snow, const real2d& cld, const real2d& cldfsnow, const real2d& iclwp,
42  const real2d& iciwp, const real2d& icswp, const real2d& lambdac, const real2d& mu, const real2d& dei, const real2d& des,
43  const real2d& rei, const real3d& tau_out, const real3d& liq_tau_out, const real3d& ice_tau_out, const real3d& snw_tau_out);
44 
45  // sample short wave cloud optics property
46  void sample_cloud_optics_sw (int ncol, int nlev, int ngpt, const int1d& gpt2bnd,
47  const real2d& pmid, const real2d& cld, const real2d& cldfsnow,
48  const real3d& tau_bnd, const real3d& ssa_bnd, const real3d& asm_bnd,
49  const real3d& tau_gpt, const real3d& ssa_gpt, const real3d& asm_gpt);
50 
51  // sample long wave cloud optics property
52  void sample_cloud_optics_lw (int ncol, int nlev, int ngpt, const int1d& gpt2bnd,
53  const real2d& pmid, const real2d& cld, const real2d& cldfsnow,
54  const real3d& tau_bnd, const real3d& tau_gpt);
55 
56  // set the short wave aerosol optics property
57  void set_aerosol_optics_sw (int icall, int ncol, int nlev, int nswbands, real dt, const int1d& night_indices,
58  bool is_cmip6_volc, const real3d& tau_out, const real3d& ssa_out, const real3d& asm_out,
59  const real2d& clear_rh);
60 
61  // set the long wave aerosol optics property
62  void set_aerosol_optics_lw (int icall, real dt, bool is_cmip6_volc, const real2d& zi,
63  const real3d& tau, const real2d& clear_rh);
64 
65  // mcica subcol mask
66  void mcica_subcol_mask (int ngpt, int ncol, int nlev, const real2d& cldfrac, const bool3d& iscloudy);
67 
68  // combine properties
69  void combine_properties (int nbands, int ncols, int nlevs,
70  const real2d& fraction1, const real3d& property1,
71  const real2d& fraction2, const real3d& property2,
72  const real3d& combined_property);
73 
74  // initialize and load gas property data for rrtmgp radiation
75  void initialize (int ngas, int nmodes, int num_aeros,
76  int nswbands, int nlwbands,
77  int ncol, int nlev, int nrh, int top_lev,
78  const std::vector<std::string>& aero_names,
79  const real2d& zi, const real2d& pmid, const real2d& pdel,
80  const real2d& temp, const real2d& qi,
81  const real2d& geom_radius);
82 
83  // finalize/clean up
84  void finalize ();
85 
86  private:
87  // number of gas for radiation model
88  int ngas;
89  char** gas_names;
90 
91  std::string icecldoptics;
92  std::string liqcldoptics;
93 
96 };
97 
98 #endif // ERF_OPTICS_H
Definition: ERF_AeroRadProps.H:18
Definition: ERF_CloudRadProps.H:14
Definition: ERF_Optics.H:24
void initialize(int ngas, int nmodes, int num_aeros, int nswbands, int nlwbands, int ncol, int nlev, int nrh, int top_lev, const std::vector< std::string > &aero_names, const real2d &zi, const real2d &pmid, const real2d &pdel, const real2d &temp, const real2d &qi, const real2d &geom_radius)
Definition: ERF_Optics.cpp:12
void mcica_subcol_mask(int ngpt, int ncol, int nlev, const real2d &cldfrac, const bool3d &iscloudy)
Definition: ERF_Optics.cpp:428
AerRadProps aero_optics
Definition: ERF_Optics.H:95
std::string icecldoptics
Definition: ERF_Optics.H:91
Optics()=default
void set_aerosol_optics_sw(int icall, int ncol, int nlev, int nswbands, real dt, const int1d &night_indices, bool is_cmip6_volc, const real3d &tau_out, const real3d &ssa_out, const real3d &asm_out, const real2d &clear_rh)
Definition: ERF_Optics.cpp:358
void combine_properties(int nbands, int ncols, int nlevs, const real2d &fraction1, const real3d &property1, const real2d &fraction2, const real3d &property2, const real3d &combined_property)
Definition: ERF_Optics.cpp:256
std::string liqcldoptics
Definition: ERF_Optics.H:92
CloudRadProps cloud_optics
Definition: ERF_Optics.H:94
void sample_cloud_optics_lw(int ncol, int nlev, int ngpt, const int1d &gpt2bnd, const real2d &pmid, const real2d &cld, const real2d &cldfsnow, const real3d &tau_bnd, const real3d &tau_gpt)
Definition: ERF_Optics.cpp:324
Optics(int ngases, char *gas_names[])
char ** gas_names
Definition: ERF_Optics.H:89
int ngas
Definition: ERF_Optics.H:88
void sample_cloud_optics_sw(int ncol, int nlev, int ngpt, const int1d &gpt2bnd, const real2d &pmid, const real2d &cld, const real2d &cldfsnow, const real3d &tau_bnd, const real3d &ssa_bnd, const real3d &asm_bnd, const real3d &tau_gpt, const real3d &ssa_gpt, const real3d &asm_gpt)
Definition: ERF_Optics.cpp:286
void finalize()
Definition: ERF_Optics.cpp:26
~Optics()=default
void set_aerosol_optics_lw(int icall, real dt, bool is_cmip6_volc, const real2d &zi, const real3d &tau, const real2d &clear_rh)
Definition: ERF_Optics.cpp:414
void get_cloud_optics_sw(int ncol, int nlev, int nbnd, bool do_snow, const real2d &cld, const real2d &cldfsnow, const real2d &iclwp, const real2d &iciwp, const real2d &icswp, const real2d &lambdac, const real2d &mu, const real2d &dei, const real2d &des, const real2d &rel, const real2d &rei, const real3d &tau_out, const real3d &ssa_out, const real3d &asm_out, const real3d &liq_tau_out, const real3d &ice_tau_out, const real3d &snw_tau_out)
Definition: ERF_Optics.cpp:32
void get_cloud_optics_lw(int ncol, int nlev, int nbnd, bool do_snow, const real2d &cld, const real2d &cldfsnow, const real2d &iclwp, const real2d &iciwp, const real2d &icswp, const real2d &lambdac, const real2d &mu, const real2d &dei, const real2d &des, const real2d &rei, const real3d &tau_out, const real3d &liq_tau_out, const real3d &ice_tau_out, const real3d &snw_tau_out)
Definition: ERF_Optics.cpp:182