ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_TI_fast_headers.H
Go to the documentation of this file.
1 #ifndef ERF_FAST_INTEGRATION_H_
2 #define ERF_FAST_INTEGRATION_H_
3 
4 #include <AMReX_MultiFab.H>
5 #include <AMReX_BCRec.H>
6 #include <AMReX_YAFluxRegister.H>
7 #include "ERF_DataStruct.H"
8 #include "ERF_IndexDefines.H"
9 #include <ERF_TerrainMetrics.H>
10 
11 #include <ERF_TileNoZ.H>
12 #include <ERF_prob_common.H>
13 
14 #ifdef ERF_USE_EB
15 #include <AMReX_EBMultiFabUtil.H>
16 #endif
17 
18 /**
19  * Function for computing the fast RHS with no terrain
20  *
21  */
22 void erf_fast_rhs_N (int step, int nrk, int level, int finest_level,
23  amrex::Vector<amrex::MultiFab >& S_slow_rhs,
24  const amrex::Vector<amrex::MultiFab >& S_prev,
25  amrex::Vector<amrex::MultiFab >& S_stage_data,
26  const amrex::MultiFab& S_stage_prim,
27  const amrex::MultiFab& pi_stage,
28  const amrex::MultiFab& fast_coeffs,
29  amrex::Vector<amrex::MultiFab >& S_data,
30  amrex::Vector<amrex::MultiFab >& S_scratch,
31  const amrex::Geometry geom,
32  const amrex::Real gravity,
33  const amrex::Real dtau, const amrex::Real beta_s,
34  const amrex::Real facinv,
35  std::unique_ptr<amrex::MultiFab>& mapfac_m,
36  std::unique_ptr<amrex::MultiFab>& mapfac_u,
37  std::unique_ptr<amrex::MultiFab>& mapfac_v,
38  amrex::YAFluxRegister* fr_as_crse,
39  amrex::YAFluxRegister* fr_as_fine,
40  bool l_use_moisture, bool l_reflux,
41  bool l_implicit_substepping);
42 
43 /**
44  * Function for computing the fast RHS with fixed terrain
45  *
46  */
47 void erf_fast_rhs_T (int step, int nrk, int level, int finest_level,
48  amrex::Vector<amrex::MultiFab >& S_slow_rhs,
49  const amrex::Vector<amrex::MultiFab >& S_prev,
50  amrex::Vector<amrex::MultiFab >& S_stage_data,
51  const amrex::MultiFab& S_stage_prim,
52  const amrex::MultiFab& pi_stage,
53  const amrex::MultiFab& fast_coeffs,
54  amrex::Vector<amrex::MultiFab >& S_data,
55  amrex::Vector<amrex::MultiFab >& S_scratch,
56  const amrex::Geometry geom,
57  const amrex::Real gravity,
58  amrex::MultiFab& Omega,
59  std::unique_ptr<amrex::MultiFab>& z_phys_nd,
60  std::unique_ptr<amrex::MultiFab>& detJ_cc,
61  const amrex::Real dtau, const amrex::Real beta_s,
62  const amrex::Real facinv,
63  std::unique_ptr<amrex::MultiFab>& mapfac_m,
64  std::unique_ptr<amrex::MultiFab>& mapfac_u,
65  std::unique_ptr<amrex::MultiFab>& mapfac_v,
66  amrex::YAFluxRegister* fr_as_crse,
67  amrex::YAFluxRegister* fr_as_fine,
68  bool l_use_moisture, bool l_reflux,
69  bool l_implicit_substepping);
70 
71 /**
72  * Function for computing the fast RHS with moving terrain
73  *
74  */
75 void erf_fast_rhs_MT (int step, int nrk, int level, int finest_level,
76  amrex::Vector<amrex::MultiFab >& S_slow_rhs,
77  const amrex::Vector<amrex::MultiFab >& S_prev,
78  amrex::Vector<amrex::MultiFab >& S_stg_data,
79  const amrex::MultiFab& S_stg_prim,
80  const amrex::MultiFab& pi_stage,
81  const amrex::MultiFab& fast_coeffs,
82  amrex::Vector<amrex::MultiFab >& S_data,
83  amrex::Vector<amrex::MultiFab >& S_scratch,
84  const amrex::Geometry geom,
85  const amrex::Real gravity,
86  const bool use_lagged_delta_rt,
87  amrex::MultiFab& Omega,
88  std::unique_ptr<amrex::MultiFab>& z_t_rk,
89  const amrex::MultiFab* z_t_pert,
90  std::unique_ptr<amrex::MultiFab>& z_phys_nd_old,
91  std::unique_ptr<amrex::MultiFab>& z_phys_nd_new,
92  std::unique_ptr<amrex::MultiFab>& z_phys_nd_stg,
93  std::unique_ptr<amrex::MultiFab>& detJ_cc_old,
94  std::unique_ptr<amrex::MultiFab>& detJ_cc_new,
95  std::unique_ptr<amrex::MultiFab>& detJ_cc_stg,
96  const amrex::Real dtau, const amrex::Real beta_s,
97  const amrex::Real facinv,
98  std::unique_ptr<amrex::MultiFab>& mapfac_m,
99  std::unique_ptr<amrex::MultiFab>& mapfac_u,
100  std::unique_ptr<amrex::MultiFab>& mapfac_v,
101  amrex::YAFluxRegister* fr_as_crse,
102  amrex::YAFluxRegister* fr_as_fine,
103  bool l_use_moisture, bool l_reflux,
104  bool l_implicit_substepping);
105 
106 /**
107  * Function for computing the coefficients for the tridiagonal solver used in the fast
108  * integrator (the acoustic substepping).
109  */
110 void make_fast_coeffs (int level,
111  amrex::MultiFab& fast_coeffs,
112  amrex::Vector<amrex::MultiFab >& S_stage_data,
113  const amrex::MultiFab& S_stage_prim,
114  const amrex::MultiFab& pi_stage,
115  const amrex::Geometry geom,
116  const bool use_moisture,
117  const bool use_terrain,
118  const amrex::Real gravity,
119  const amrex::Real c_p,
120  std::unique_ptr<amrex::MultiFab>& detJ_cc,
121  const amrex::MultiFab* r0,
122  const amrex::MultiFab* pi0,
123  const amrex::Real dtau,
124  const amrex::Real beta_s,
125  amrex::GpuArray<ERF_BC, AMREX_SPACEDIM*2> &phys_bc_type);
126 
127 #endif
void erf_fast_rhs_N(int step, int nrk, int level, int finest_level, amrex::Vector< amrex::MultiFab > &S_slow_rhs, const amrex::Vector< amrex::MultiFab > &S_prev, amrex::Vector< amrex::MultiFab > &S_stage_data, const amrex::MultiFab &S_stage_prim, const amrex::MultiFab &pi_stage, const amrex::MultiFab &fast_coeffs, amrex::Vector< amrex::MultiFab > &S_data, amrex::Vector< amrex::MultiFab > &S_scratch, const amrex::Geometry geom, const amrex::Real gravity, const amrex::Real dtau, const amrex::Real beta_s, const amrex::Real facinv, std::unique_ptr< amrex::MultiFab > &mapfac_m, std::unique_ptr< amrex::MultiFab > &mapfac_u, std::unique_ptr< amrex::MultiFab > &mapfac_v, amrex::YAFluxRegister *fr_as_crse, amrex::YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux, bool l_implicit_substepping)
void erf_fast_rhs_T(int step, int nrk, int level, int finest_level, amrex::Vector< amrex::MultiFab > &S_slow_rhs, const amrex::Vector< amrex::MultiFab > &S_prev, amrex::Vector< amrex::MultiFab > &S_stage_data, const amrex::MultiFab &S_stage_prim, const amrex::MultiFab &pi_stage, const amrex::MultiFab &fast_coeffs, amrex::Vector< amrex::MultiFab > &S_data, amrex::Vector< amrex::MultiFab > &S_scratch, const amrex::Geometry geom, const amrex::Real gravity, amrex::MultiFab &Omega, std::unique_ptr< amrex::MultiFab > &z_phys_nd, std::unique_ptr< amrex::MultiFab > &detJ_cc, const amrex::Real dtau, const amrex::Real beta_s, const amrex::Real facinv, std::unique_ptr< amrex::MultiFab > &mapfac_m, std::unique_ptr< amrex::MultiFab > &mapfac_u, std::unique_ptr< amrex::MultiFab > &mapfac_v, amrex::YAFluxRegister *fr_as_crse, amrex::YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux, bool l_implicit_substepping)
void erf_fast_rhs_MT(int step, int nrk, int level, int finest_level, amrex::Vector< amrex::MultiFab > &S_slow_rhs, const amrex::Vector< amrex::MultiFab > &S_prev, amrex::Vector< amrex::MultiFab > &S_stg_data, const amrex::MultiFab &S_stg_prim, const amrex::MultiFab &pi_stage, const amrex::MultiFab &fast_coeffs, amrex::Vector< amrex::MultiFab > &S_data, amrex::Vector< amrex::MultiFab > &S_scratch, const amrex::Geometry geom, const amrex::Real gravity, const bool use_lagged_delta_rt, amrex::MultiFab &Omega, std::unique_ptr< amrex::MultiFab > &z_t_rk, const amrex::MultiFab *z_t_pert, std::unique_ptr< amrex::MultiFab > &z_phys_nd_old, std::unique_ptr< amrex::MultiFab > &z_phys_nd_new, std::unique_ptr< amrex::MultiFab > &z_phys_nd_stg, std::unique_ptr< amrex::MultiFab > &detJ_cc_old, std::unique_ptr< amrex::MultiFab > &detJ_cc_new, std::unique_ptr< amrex::MultiFab > &detJ_cc_stg, const amrex::Real dtau, const amrex::Real beta_s, const amrex::Real facinv, std::unique_ptr< amrex::MultiFab > &mapfac_m, std::unique_ptr< amrex::MultiFab > &mapfac_u, std::unique_ptr< amrex::MultiFab > &mapfac_v, amrex::YAFluxRegister *fr_as_crse, amrex::YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux, bool l_implicit_substepping)
void make_fast_coeffs(int level, amrex::MultiFab &fast_coeffs, amrex::Vector< amrex::MultiFab > &S_stage_data, const amrex::MultiFab &S_stage_prim, const amrex::MultiFab &pi_stage, const amrex::Geometry geom, const bool use_moisture, const bool use_terrain, const amrex::Real gravity, const amrex::Real c_p, std::unique_ptr< amrex::MultiFab > &detJ_cc, const amrex::MultiFab *r0, const amrex::MultiFab *pi0, const amrex::Real dtau, const amrex::Real beta_s, amrex::GpuArray< ERF_BC, AMREX_SPACEDIM *2 > &phys_bc_type)