ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_RRTMGP_Interface.H
Go to the documentation of this file.
1 #ifndef ERF_RRTMGP_INTERFACE_H
2 #define ERF_RRTMGP_INTERFACE_H
3 
4 #include <rrtmgp_const.h>
5 #include <mo_gas_optics_rrtmgp.h>
6 #include <mo_cloud_optics.h>
7 #include <mo_fluxes_byband.h>
8 #include <mo_load_coefficients.h>
9 #include <mo_gas_concentrations.h>
10 #include <mo_gas_optics_rrtmgp.h>
11 #include <mo_cloud_optics.h>
12 #include <mo_rte_sw.h>
13 #include <mo_rte_lw.h>
14 #include <mo_load_cloud_coefficients.h>
15 
16 #include <ERF_RRTMGP_Utils.H>
17 #include <ERF_Constants.H>
18 
19 void init_kls ();
20 void finalize_kls ();
21 
22 namespace rrtmgp {
23 
24 extern GasOpticsRRTMGP k_dist_sw;
25 extern GasOpticsRRTMGP k_dist_lw;
26 
27 extern CloudOptics cloud_optics_sw;
28 extern CloudOptics cloud_optics_lw;
29 
30 extern bool initialized;
31 
32 void
33 rrtmgp_initialize (GasConcs &gas_concs,
34  const std::string& coefficients_file_sw, const std::string& coefficients_file_lw,
35  const std::string& cloud_optics_file_sw, const std::string& cloud_optics_file_lw);
36 
37 
38 void
40 
41 
42 void
43 compute_band_by_band_surface_albedos (const int ncol, const int nswbands,
44  real1d &sfc_alb_dir_vis, real1d &sfc_alb_dir_nir,
45  real1d &sfc_alb_dif_vis, real1d &sfc_alb_dif_nir,
46  real2d &sfc_alb_dir, real2d &sfc_alb_dif);
47 
48 
49 void
50 compute_broadband_surface_fluxes (const int ncol, const int ktop, const int nswbands,
51  real3d &sw_bnd_flux_dir , real3d &sw_bnd_flux_dif ,
52  real1d &sfc_flux_dir_vis, real1d &sfc_flux_dir_nir,
53  real1d &sfc_flux_dif_vis, real1d &sfc_flux_dif_nir);
54 
55 
56 void
57 rrtmgp_main (const int ncol, const int nlay,
58  real2d &p_lay, real2d &t_lay, real2d &p_lev, real2d &t_lev,
59  GasConcs &gas_concs,
60  real2d &sfc_alb_dir, real2d &sfc_alb_dif, real1d &mu0,
61  real2d &lwp, real2d &iwp, real2d &rel, real2d &rei, real2d &cldfrac,
62  real3d &aer_tau_sw, real3d &aer_ssa_sw, real3d &aer_asm_sw, real3d &aer_tau_lw,
63  real3d &cld_tau_sw_bnd, real3d &cld_tau_lw_bnd,
64  real3d &cld_tau_sw_gpt, real3d &cld_tau_lw_gpt,
65  real2d &sw_flux_up, real2d &sw_flux_dn, real2d &sw_flux_dn_dir,
66  real2d &lw_flux_up, real2d &lw_flux_dn,
67  real2d &sw_clnclrsky_flux_up, real2d &sw_clnclrsky_flux_dn, real2d &sw_clnclrsky_flux_dn_dir,
68  real2d &sw_clrsky_flux_up, real2d &sw_clrsky_flux_dn, real2d &sw_clrsky_flux_dn_dir,
69  real2d &sw_clnsky_flux_up, real2d &sw_clnsky_flux_dn, real2d &sw_clnsky_flux_dn_dir,
70  real2d &lw_clnclrsky_flux_up, real2d &lw_clnclrsky_flux_dn,
71  real2d &lw_clrsky_flux_up, real2d &lw_clrsky_flux_dn,
72  real2d &lw_clnsky_flux_up, real2d &lw_clnsky_flux_dn,
73  real3d &sw_bnd_flux_up, real3d &sw_bnd_flux_dn, real3d &sw_bnd_flux_dn_dir,
74  real3d &lw_bnd_flux_up, real3d &lw_bnd_flux_dn,
75  const real tsi_scaling,
76  const bool extra_clnclrsky_diag = false, const bool extra_clnsky_diag = false);
77 
78 
79 void
80 rrtmgp_sw (const int ncol, const int nlay,
81  GasOpticsRRTMGP &k_dist,
82  real2d &p_lay, real2d &t_lay, real2d &p_lev, real2d &t_lev,
83  GasConcs &gas_concs,
84  real2d &sfc_alb_dir, real2d &sfc_alb_dif, real1d &mu0,
85  OpticalProps2str &aerosol, OpticalProps2str &clouds,
86  FluxesByband &fluxes,
87  FluxesBroadband &clnclrsky_fluxes,
88  FluxesBroadband &clrsky_fluxes,
89  FluxesBroadband &clnsky_fluxes,
90  const real tsi_scaling,
91  const bool extra_clnclrsky_diag,
92  const bool extra_clnsky_diag);
93 
94 
95 void
96 rrtmgp_lw (const int ncol, const int nlay,
97  GasOpticsRRTMGP &k_dist,
98  real2d &p_lay, real2d &t_lay, real2d &p_lev, real2d &t_lev,
99  GasConcs &gas_concs,
100  OpticalProps1scl &aerosol, OpticalProps1scl &clouds,
101  FluxesByband &fluxes,
102  FluxesBroadband &clnclrsky_fluxes,
103  FluxesBroadband &clrsky_fluxes,
104  FluxesBroadband &clnsky_fluxes,
105  const bool extra_clnclrsky_diag,
106  const bool extra_clnsky_diag);
107 
108 
109 int3d
110 get_subcolumn_mask (const int ncol,
111  const int nlay,
112  const int ngpt,
113  real2d &cldf,
114  const int overlap_option,
115  int1d &seeds);
116 
117 
118 void
119 compute_cloud_area (int ncol,
120  int nlay,
121  int ngpt,
122  real pmin,
123  real pmax,
124  const real2d& pmid,
125  const real3d& cld_tau_gpt,
126  real1d& cld_area);
127 
128 
129 void
130 compute_aerocom_cloudtop (int ncol, int nlay, const real2d &tmid, const real2d &pmid,
131  const real2d &p_del, const real2d &z_del, const real2d &qc,
132  const real2d &qi, const real2d &rel, const real2d &rei,
133  const real2d &cldfrac_tot, const real2d &nc,
134  real1d &T_mid_at_cldtop, real1d &p_mid_at_cldtop,
135  real1d &cldfrac_ice_at_cldtop, real1d &cldfrac_liq_at_cldtop,
136  real1d &cldfrac_tot_at_cldtop, real1d &cdnc_at_cldtop,
137  real1d &eff_radius_qc_at_cldtop, real1d &eff_radius_qi_at_cldtop);
138 
139 int get_wavelength_index (OpticalProps &kdist, double wavelength);
140 int get_wavelength_index_sw (double wavelength);
141 int get_wavelength_index_lw (double wavelength);
142 
143 } // namespace rrtmgp
144 #endif
double real
Definition: ERF_OrbCosZenith.H:9
void init_kls()
Definition: ERF_RRTMGP_Interface.cpp:3
void finalize_kls()
Definition: ERF_RRTMGP_Interface.cpp:9
@ qc
Definition: ERF_SatAdj.H:36
Definition: ERF_RRTMGP_Interface.cpp:15
void rrtmgp_finalize()
Definition: ERF_RRTMGP_Interface.cpp:257
CloudOptics cloud_optics_sw
Definition: ERF_RRTMGP_Interface.cpp:34
int3d get_subcolumn_mask(const int ncol, const int nlay, const int ngpt, real2d &cldf, const int overlap_option, int1d &seeds)
Definition: ERF_RRTMGP_Interface.cpp:521
void rrtmgp_sw(const int ncol, const int nlay, GasOpticsRRTMGP &k_dist, real2d &p_lay, real2d &t_lay, real2d &p_lev, real2d &t_lev, GasConcs &gas_concs, real2d &sfc_alb_dir, real2d &sfc_alb_dif, real1d &mu0, OpticalProps2str &aerosol, OpticalProps2str &clouds, FluxesByband &fluxes, FluxesBroadband &clnclrsky_fluxes, FluxesBroadband &clrsky_fluxes, FluxesBroadband &clnsky_fluxes, const real tsi_scaling, const bool extra_clnclrsky_diag, const bool extra_clnsky_diag)
Definition: ERF_RRTMGP_Interface.cpp:594
void compute_band_by_band_surface_albedos(const int ncol, const int nswbands, real1d &sfc_alb_dir_vis, real1d &sfc_alb_dir_nir, real1d &sfc_alb_dif_vis, real1d &sfc_alb_dif_nir, real2d &sfc_alb_dir, real2d &sfc_alb_dif)
Definition: ERF_RRTMGP_Interface.cpp:268
void rrtmgp_lw(const int ncol, const int nlay, GasOpticsRRTMGP &k_dist, real2d &p_lay, real2d &t_lay, real2d &p_lev, real2d &t_lev, GasConcs &gas_concs, OpticalProps1scl &aerosol, OpticalProps1scl &clouds, FluxesByband &fluxes, FluxesBroadband &clnclrsky_fluxes, FluxesBroadband &clrsky_fluxes, FluxesBroadband &clnsky_fluxes, const bool extra_clnclrsky_diag, const bool extra_clnsky_diag)
Definition: ERF_RRTMGP_Interface.cpp:873
int get_wavelength_index_lw(double wavelength)
Definition: ERF_RRTMGP_Interface.cpp:1048
void compute_aerocom_cloudtop(int ncol, int nlay, const real2d &tmid, const real2d &pmid, const real2d &p_del, const real2d &z_del, const real2d &qc, const real2d &qi, const real2d &rel, const real2d &rei, const real2d &cldfrac_tot, const real2d &nc, real1d &T_mid_at_cldtop, real1d &p_mid_at_cldtop, real1d &cldfrac_ice_at_cldtop, real1d &cldfrac_liq_at_cldtop, real1d &cldfrac_tot_at_cldtop, real1d &cdnc_at_cldtop, real1d &eff_radius_qc_at_cldtop, real1d &eff_radius_qi_at_cldtop)
Definition: ERF_RRTMGP_Interface.cpp:1080
CloudOptics cloud_optics_lw
Definition: ERF_RRTMGP_Interface.cpp:35
int get_wavelength_index_sw(double wavelength)
Definition: ERF_RRTMGP_Interface.cpp:1044
void rrtmgp_main(const int ncol, const int nlay, real2d &p_lay, real2d &t_lay, real2d &p_lev, real2d &t_lev, GasConcs &gas_concs, real2d &sfc_alb_dir, real2d &sfc_alb_dif, real1d &mu0, real2d &lwp, real2d &iwp, real2d &rel, real2d &rei, real2d &cldfrac, real3d &aer_tau_sw, real3d &aer_ssa_sw, real3d &aer_asm_sw, real3d &aer_tau_lw, real3d &cld_tau_sw_bnd, real3d &cld_tau_lw_bnd, real3d &cld_tau_sw_gpt, real3d &cld_tau_lw_gpt, real2d &sw_flux_up, real2d &sw_flux_dn, real2d &sw_flux_dn_dir, real2d &lw_flux_up, real2d &lw_flux_dn, real2d &sw_clnclrsky_flux_up, real2d &sw_clnclrsky_flux_dn, real2d &sw_clnclrsky_flux_dn_dir, real2d &sw_clrsky_flux_up, real2d &sw_clrsky_flux_dn, real2d &sw_clrsky_flux_dn_dir, real2d &sw_clnsky_flux_up, real2d &sw_clnsky_flux_dn, real2d &sw_clnsky_flux_dn_dir, real2d &lw_clnclrsky_flux_up, real2d &lw_clnclrsky_flux_dn, real2d &lw_clrsky_flux_up, real2d &lw_clrsky_flux_dn, real2d &lw_clnsky_flux_up, real2d &lw_clnsky_flux_dn, real3d &sw_bnd_flux_up, real3d &sw_bnd_flux_dn, real3d &sw_bnd_flux_dn_dir, real3d &lw_bnd_flux_up, real3d &lw_bnd_flux_dn, const real tsi_scaling, const bool extra_clnclrsky_diag, const bool extra_clnsky_diag)
Definition: ERF_RRTMGP_Interface.cpp:391
void rrtmgp_initialize(GasConcs &gas_concs, const std::string &coefficients_file_sw, const std::string &coefficients_file_lw, const std::string &cloud_optics_file_sw, const std::string &cloud_optics_file_lw)
Definition: ERF_RRTMGP_Interface.cpp:234
GasOpticsRRTMGP k_dist_lw
Definition: ERF_RRTMGP_Interface.cpp:27
void compute_cloud_area(int ncol, int nlay, int ngpt, const real pmin, const real pmax, const real2d &pmid, const real3d &cld_tau_gpt, real1d &cld_area)
Definition: ERF_RRTMGP_Interface.cpp:1009
GasOpticsRRTMGP k_dist_sw
Definition: ERF_RRTMGP_Interface.cpp:26
int get_wavelength_index(OpticalProps &kdist, double wavelength)
Definition: ERF_RRTMGP_Interface.cpp:1052
void compute_broadband_surface_fluxes(const int ncol, const int ktop, const int nswbands, real3d &sw_bnd_flux_dir, real3d &sw_bnd_flux_dif, real1d &sfc_flux_dir_vis, real1d &sfc_flux_dir_nir, real1d &sfc_flux_dif_vis, real1d &sfc_flux_dif_nir)
Definition: ERF_RRTMGP_Interface.cpp:328
bool initialized
Definition: ERF_RRTMGP_Interface.cpp:37