diff --git a/Source/Derive.H b/Source/Derive.H index 42b69ac99..f405ed4f1 100644 --- a/Source/Derive.H +++ b/Source/Derive.H @@ -6,13 +6,13 @@ namespace derived { -void erf_derrhodivide( +void erf_derrhodivide ( const amrex::Box& bx, amrex::FArrayBox& derfab, const amrex::FArrayBox& datfab, const int scalar_index); -void erf_dernull( +void erf_dernull ( const amrex::Box& bx, amrex::FArrayBox& derfab, int dcomp, @@ -23,7 +23,7 @@ void erf_dernull( const int* bcrec, const int level); -void erf_derpres( +void erf_derpres ( const amrex::Box& bx, amrex::FArrayBox& derfab, int dcomp, @@ -34,7 +34,7 @@ void erf_derpres( const int* bcrec, const int level); -void erf_dersoundspeed( +void erf_dersoundspeed ( const amrex::Box& bx, amrex::FArrayBox& derfab, int dcomp, @@ -45,7 +45,7 @@ void erf_dersoundspeed( const int* bcrec, const int level); -void erf_dertemp( +void erf_dertemp ( const amrex::Box& bx, amrex::FArrayBox& derfab, int dcomp, @@ -56,7 +56,7 @@ void erf_dertemp( const int* bcrec, const int level); -void erf_dertheta( +void erf_dertheta ( const amrex::Box& bx, amrex::FArrayBox& derfab, int dcomp, @@ -67,7 +67,7 @@ void erf_dertheta( const int* bcrec, const int level); -void erf_derscalar( +void erf_derscalar ( const amrex::Box& bx, amrex::FArrayBox& derfab, int dcomp, @@ -78,7 +78,7 @@ void erf_derscalar( const int* bcrec, const int level); -void erf_derKE( +void erf_derKE ( const amrex::Box& bx, amrex::FArrayBox& derfab, int dcomp, @@ -89,7 +89,7 @@ void erf_derKE( const int* bcrec, const int level); -void erf_derQKE( +void erf_derQKE ( const amrex::Box& bx, amrex::FArrayBox& derfab, int dcomp, @@ -101,7 +101,7 @@ void erf_derQKE( const int level); #if defined(ERF_USE_MOISTURE) -void erf_derQt( +void erf_derQt ( const amrex::Box& bx, amrex::FArrayBox& derfab, int dcomp, @@ -112,7 +112,7 @@ void erf_derQt( const int* bcrec, const int level); -void erf_derQp( +void erf_derQp ( const amrex::Box& bx, amrex::FArrayBox& derfab, int dcomp, @@ -123,7 +123,7 @@ void erf_derQp( const int* bcrec, const int level); #elif defined(ERF_USE_WARM_NO_PRECIP) -void erf_derQv( +void erf_derQv ( const amrex::Box& bx, amrex::FArrayBox& derfab, int dcomp, @@ -133,7 +133,7 @@ void erf_derQv( amrex::Real time, const int* bcrec, const int level); -void erf_derQc( +void erf_derQc ( const amrex::Box& bx, amrex::FArrayBox& derfab, int dcomp, diff --git a/Source/Derive.cpp b/Source/Derive.cpp index 4e6b5b661..9ed1f85c8 100644 --- a/Source/Derive.cpp +++ b/Source/Derive.cpp @@ -13,7 +13,7 @@ namespace derived { * @params[in] datfab array of data used to construct derived quantity * @params[in] scalar_index index of quantity to be divided by density */ -void erf_derrhodivide( +void erf_derrhodivide ( const amrex::Box& bx, amrex::FArrayBox& derfab, const amrex::FArrayBox& datfab, @@ -34,7 +34,7 @@ void erf_derrhodivide( * Placeholder function that does nothing */ void -erf_dernull( +erf_dernull ( const amrex::Box& /*bx*/, amrex::FArrayBox& /*derfab*/, int /*dcomp*/, @@ -54,7 +54,7 @@ erf_dernull( * @params[in] datfab array of data used to construct derived quantity */ void -erf_derpres( +erf_derpres ( const amrex::Box& bx, amrex::FArrayBox& derfab, int /*dcomp*/, @@ -92,7 +92,7 @@ erf_derpres( * @params[in] datfab array of data used to construct derived quantity */ void -erf_dersoundspeed( +erf_dersoundspeed ( const amrex::Box& bx, amrex::FArrayBox& derfab, int /*dcomp*/, @@ -125,7 +125,7 @@ erf_dersoundspeed( * @params[in] datfab array of data used to construct derived quantity */ void -erf_dertemp( +erf_dertemp ( const amrex::Box& bx, amrex::FArrayBox& derfab, int /*dcomp*/, @@ -155,7 +155,7 @@ erf_dertemp( * @params[in] datfab array of data used to construct derived quantity */ void -erf_dertheta( +erf_dertheta ( const amrex::Box& bx, amrex::FArrayBox& derfab, int /*dcomp*/, @@ -177,7 +177,7 @@ erf_dertheta( * @params[in] datfab array of data used to construct derived quantity */ void -erf_derscalar( +erf_derscalar ( const amrex::Box& bx, amrex::FArrayBox& derfab, int /*dcomp*/, @@ -199,7 +199,7 @@ erf_derscalar( * @params[in] datfab array of data used to construct derived quantity */ void -erf_derKE( +erf_derKE ( const amrex::Box& bx, amrex::FArrayBox& derfab, int /*dcomp*/, @@ -221,7 +221,7 @@ erf_derKE( * @params[in] datfab array of data used to construct derived quantity */ void -erf_derQKE( +erf_derQKE ( const amrex::Box& bx, amrex::FArrayBox& derfab, int /*dcomp*/, @@ -244,7 +244,7 @@ erf_derQKE( * @params[in] datfab array of data used to construct derived quantity */ void -erf_derQt( +erf_derQt ( const amrex::Box& bx, amrex::FArrayBox& derfab, int /*dcomp*/, @@ -266,7 +266,7 @@ erf_derQt( * @params[in] datfab array of data used to construct derived quantity */ void -erf_derQp( +erf_derQp ( const amrex::Box& bx, amrex::FArrayBox& derfab, int /*dcomp*/, @@ -288,7 +288,7 @@ erf_derQp( * @params[in] datfab array of data used to construct derived quantity */ void -erf_derQv( +erf_derQv ( const amrex::Box& bx, amrex::FArrayBox& derfab, int /*dcomp*/, @@ -309,7 +309,7 @@ erf_derQv( * @params[in] datfab array of data used to construct derived quantity */ void -erf_derQc( +erf_derQc ( const amrex::Box& bx, amrex::FArrayBox& derfab, int /*dcomp*/, diff --git a/Source/ERF.H b/Source/ERF.H index 55a3a11b6..340a4edbb 100644 --- a/Source/ERF.H +++ b/Source/ERF.H @@ -96,17 +96,17 @@ public: // constructor - reads in parameters from inputs file // - sizes multilevel arrays and data structures ERF (); - ~ERF() override; + ~ERF () override; // Declare a default move constructor so we ensure the destructor is // not called when we return an object of this class by value - ERF(ERF&&) noexcept = delete; + ERF (ERF&&) noexcept = delete; // Declare a default move assignment operator ERF& operator=(ERF&& other) noexcept = delete; // Delete the copy constructor - ERF(const ERF& other) = delete; + ERF (const ERF& other) = delete; // // Delete the copy assignment operator ERF& operator=(const ERF& other) = delete; @@ -315,7 +315,7 @@ private: /////////////////////////// // read in some parameters from inputs file - void ReadParameters(); + void ReadParameters (); // set covered coarse cells to be the average of overlying fine cells void AverageDown (); @@ -755,7 +755,7 @@ private: amrex::Gpu::DeviceVector d_havg_qc; #endif - void refinement_criteria_setup(); + void refinement_criteria_setup (); std::unique_ptr m_w2d = nullptr; std::unique_ptr m_r2d = nullptr; diff --git a/Source/ERF_Tagging.cpp b/Source/ERF_Tagging.cpp index b91af1d1e..b065afd79 100644 --- a/Source/ERF_Tagging.cpp +++ b/Source/ERF_Tagging.cpp @@ -57,7 +57,7 @@ ERF::ErrorEst (int level, TagBoxArray& tags, Real time, int /*ngrow*/) */ void -ERF::refinement_criteria_setup() +ERF::refinement_criteria_setup () { if (max_level > 0) { diff --git a/Source/ERF_make_new_level.cpp b/Source/ERF_make_new_level.cpp index bb03cae21..2ada7d831 100644 --- a/Source/ERF_make_new_level.cpp +++ b/Source/ERF_make_new_level.cpp @@ -430,7 +430,7 @@ ERF::update_terrain_arrays (int lev, Real time) } void -ERF::initialize_integrator(int lev, MultiFab& cons_mf, MultiFab& vel_mf) +ERF::initialize_integrator (int lev, MultiFab& cons_mf, MultiFab& vel_mf) { const BoxArray& ba(cons_mf.boxArray()); const DistributionMapping& dm(cons_mf.DistributionMap()); diff --git a/Source/Initialization/ERF_init1d.cpp b/Source/Initialization/ERF_init1d.cpp index 9ebab4f35..3e3f82e6b 100644 --- a/Source/Initialization/ERF_init1d.cpp +++ b/Source/Initialization/ERF_init1d.cpp @@ -14,7 +14,7 @@ using namespace amrex; * the effects of Rayleigh Damping. */ void -ERF::initRayleigh() +ERF::initRayleigh () { AMREX_ALWAYS_ASSERT(solverChoice.use_rayleigh_damping); @@ -68,7 +68,7 @@ ERF::initRayleigh() we are currently restarting from a checkpoint file. */ void -ERF::setRayleighRefFromSounding(bool restarting) +ERF::setRayleighRefFromSounding (bool restarting) { // If we are restarting then we haven't read the input_sounding file yet // so we need to read it here @@ -123,7 +123,7 @@ ERF::setRayleighRefFromSounding(bool restarting) * hydrostatic equilibrium. */ void -ERF::initHSE(int lev) +ERF::initHSE (int lev) { MultiFab r_hse (base_state[lev], make_alias, 0, 1); // r_0 is first component MultiFab p_hse (base_state[lev], make_alias, 1, 1); // p_0 is second component @@ -138,7 +138,7 @@ ERF::initHSE(int lev) } void -ERF::initHSE() +ERF::initHSE () { AMREX_ALWAYS_ASSERT(!init_sounding_ideal); for (int lev = 0; lev <= finest_level; lev++) @@ -158,10 +158,10 @@ ERF::initHSE() * @param[in] z_nd Pointer to MultiFab storing node centered z-coordinates */ void -ERF::erf_enforce_hse(int lev, - MultiFab& dens, MultiFab& pres, MultiFab& pi, - std::unique_ptr& z_cc, - std::unique_ptr& z_nd) +ERF::erf_enforce_hse (int lev, + MultiFab& dens, MultiFab& pres, MultiFab& pi, + std::unique_ptr& z_cc, + std::unique_ptr& z_nd) { amrex::Real l_gravity = solverChoice.gravity; bool l_use_terrain = solverChoice.use_terrain; diff --git a/Source/Initialization/ERF_init_from_input_sounding.cpp b/Source/Initialization/ERF_init_from_input_sounding.cpp index 63be64f58..568d87e01 100644 --- a/Source/Initialization/ERF_init_from_input_sounding.cpp +++ b/Source/Initialization/ERF_init_from_input_sounding.cpp @@ -11,12 +11,12 @@ using namespace amrex; void -init_bx_scalars_from_input_sounding( const amrex::Box &bx, +init_bx_scalars_from_input_sounding (const amrex::Box &bx, amrex::Array4 const &state, amrex::GeometryData const &geomdata, InputSoundingData const &inputSoundingData); void -init_bx_scalars_from_input_sounding_hse( const amrex::Box &bx, +init_bx_scalars_from_input_sounding_hse (const amrex::Box &bx, amrex::Array4 const &state, amrex::Array4 const &r_hse_arr, amrex::Array4 const &p_hse_arr, @@ -26,7 +26,7 @@ init_bx_scalars_from_input_sounding_hse( const amrex::Box &bx, InputSoundingData const &inputSoundingData); void -init_bx_velocities_from_input_sounding( const amrex::Box &bx, +init_bx_velocities_from_input_sounding (const amrex::Box &bx, amrex::Array4 const &x_vel, amrex::Array4 const &y_vel, amrex::Array4 const &z_vel, @@ -40,7 +40,7 @@ init_bx_velocities_from_input_sounding( const amrex::Box &bx, * @param lev Integer specifying the current level */ void -ERF::init_from_input_sounding(int lev) +ERF::init_from_input_sounding (int lev) { // We only want to read the file once -- here we fill one FArrayBox (per variable) that spans the domain if (lev == 0) { @@ -108,7 +108,7 @@ ERF::init_from_input_sounding(int lev) * @param inputSoundingData InputSoundingData object we are to initialize from */ void -init_bx_scalars_from_input_sounding( const amrex::Box &bx, +init_bx_scalars_from_input_sounding (const amrex::Box &bx, amrex::Array4 const &state, amrex::GeometryData const &geomdata, InputSoundingData const &inputSoundingData) @@ -167,7 +167,7 @@ init_bx_scalars_from_input_sounding( const amrex::Box &bx, * @param inputSoundingData InputSoundingData object we are to initialize from */ void -init_bx_scalars_from_input_sounding_hse( const amrex::Box &bx, +init_bx_scalars_from_input_sounding_hse (const amrex::Box &bx, amrex::Array4 const &state, amrex::Array4 const &r_hse_arr, amrex::Array4 const &p_hse_arr, @@ -255,7 +255,7 @@ init_bx_scalars_from_input_sounding_hse( const amrex::Box &bx, * @param inputSoundingData InputSoundingData object we are to initialize from */ void -init_bx_velocities_from_input_sounding( const amrex::Box &bx, +init_bx_velocities_from_input_sounding (const amrex::Box &bx, amrex::Array4 const &x_vel, amrex::Array4 const &y_vel, amrex::Array4 const &z_vel, diff --git a/Source/Initialization/ERF_init_from_metgrid.cpp b/Source/Initialization/ERF_init_from_metgrid.cpp index f410aa4bb..26453d2db 100644 --- a/Source/Initialization/ERF_init_from_metgrid.cpp +++ b/Source/Initialization/ERF_init_from_metgrid.cpp @@ -11,42 +11,42 @@ using namespace amrex; void -read_from_metgrid(int lev, const Box& domain, const std::string& fname, - FArrayBox& NC_xvel_fab, FArrayBox& NC_yvel_fab, - FArrayBox& NC_temp_fab, FArrayBox& NC_rhum_fab, - FArrayBox& NC_pres_fab, FArrayBox& NC_hgt_fab, - FArrayBox& NC_msfu_fab, FArrayBox& NC_msfv_fab, - FArrayBox& NC_msfm_fab); +read_from_metgrid (int lev, const Box& domain, const std::string& fname, + FArrayBox& NC_xvel_fab, FArrayBox& NC_yvel_fab, + FArrayBox& NC_temp_fab, FArrayBox& NC_rhum_fab, + FArrayBox& NC_pres_fab, FArrayBox& NC_hgt_fab, + FArrayBox& NC_msfu_fab, FArrayBox& NC_msfv_fab, + FArrayBox& NC_msfm_fab); void -interpolate_column(int i, int j, int src_comp, int dest_comp, - const Array4& orig_z, const Array4& orig_data, - const Array4& new_z, const Array4& new_data); +interpolate_column (int i, int j, int src_comp, int dest_comp, + const Array4& orig_z, const Array4& orig_data, + const Array4& new_z, const Array4& new_data); void -init_terrain_from_metgrid(int lev, FArrayBox& z_phys_nd_fab, - const Vector& NC_hgt_fab); +init_terrain_from_metgrid (int lev, FArrayBox& z_phys_nd_fab, + const Vector& NC_hgt_fab); void -init_state_from_metgrid(int lev, FArrayBox& state_fab, - FArrayBox& x_vel_fab, FArrayBox& y_vel_fab, - FArrayBox& z_vel_fab, FArrayBox& z_phys_nd_fab, - const Vector& NC_hgt_fab, - const Vector& NC_xvel_fab, - const Vector& NC_yvel_fab, - const Vector& NC_zvel_fab, - const Vector& NC_rho_fab, - const Vector& NC_rhotheta_fab); +init_state_from_metgrid (int lev, FArrayBox& state_fab, + FArrayBox& x_vel_fab, FArrayBox& y_vel_fab, + FArrayBox& z_vel_fab, FArrayBox& z_phys_nd_fab, + const Vector& NC_hgt_fab, + const Vector& NC_xvel_fab, + const Vector& NC_yvel_fab, + const Vector& NC_zvel_fab, + const Vector& NC_rho_fab, + const Vector& NC_rhotheta_fab); void -init_msfs_from_metgrid(int lev, FArrayBox& msfu_fab, - FArrayBox& msfv_fab, FArrayBox& msfm_fab, - const Vector& NC_MSFU_fab, - const Vector& NC_MSFV_fab, - const Vector& NC_MSFM_fab); +init_msfs_from_metgrid (int lev, FArrayBox& msfu_fab, + FArrayBox& msfv_fab, FArrayBox& msfm_fab, + const Vector& NC_MSFU_fab, + const Vector& NC_MSFV_fab, + const Vector& NC_MSFM_fab); void -init_base_state_from_metgrid(int lev, const Box& valid_bx, Real l_rdOcp, - FArrayBox& p_hse, FArrayBox& pi_hse, FArrayBox& r_hse, - const Vector& NC_ALB_fab, - const Vector& NC_PB_fab); +init_base_state_from_metgrid (int lev, const Box& valid_bx, Real l_rdOcp, + FArrayBox& p_hse, FArrayBox& pi_hse, FArrayBox& r_hse, + const Vector& NC_ALB_fab, + const Vector& NC_PB_fab); #ifdef ERF_USE_NETCDF /** @@ -55,7 +55,7 @@ init_base_state_from_metgrid(int lev, const Box& valid_bx, Real l_rdOcp, * @param lev Integer specifying the current level */ void -ERF::init_from_metgrid(int lev) +ERF::init_from_metgrid (int lev) { // *** FArrayBox's at this level for holding the INITIAL data Vector NC_xvel_fab ; NC_xvel_fab.resize(num_boxes_at_level[lev]); @@ -175,8 +175,8 @@ ERF::init_from_metgrid(int lev) * @param NC_hgt_fab Vector of FArrayBox objects holding height data read from NetCDF files for metgrid data */ void -init_terrain_from_metgrid(int lev, FArrayBox& z_phys_nd_fab, - const Vector& NC_hgt_fab) +init_terrain_from_metgrid (int lev, FArrayBox& z_phys_nd_fab, + const Vector& NC_hgt_fab) { int nboxes = NC_hgt_fab.size(); @@ -241,15 +241,15 @@ init_terrain_from_metgrid(int lev, FArrayBox& z_phys_nd_fab, * @param NC_rhotheta_fab Vector of FArrayBox obects holding metgrid data for (density * potential temperature) */ void -init_state_from_metgrid(int lev, FArrayBox& state_fab, - FArrayBox& x_vel_fab, FArrayBox& y_vel_fab, - FArrayBox& z_vel_fab, FArrayBox& z_phys_nd_fab, - const Vector& NC_hgt_fab, - const Vector& NC_xvel_fab, - const Vector& NC_yvel_fab, - const Vector& NC_zvel_fab, - const Vector& NC_rho_fab, - const Vector& NC_rhotheta_fab) +init_state_from_metgrid (int lev, FArrayBox& state_fab, + FArrayBox& x_vel_fab, FArrayBox& y_vel_fab, + FArrayBox& z_vel_fab, FArrayBox& z_phys_nd_fab, + const Vector& NC_hgt_fab, + const Vector& NC_xvel_fab, + const Vector& NC_yvel_fab, + const Vector& NC_zvel_fab, + const Vector& NC_rho_fab, + const Vector& NC_rhotheta_fab) { int nboxes = NC_hgt_fab.size(); @@ -351,11 +351,11 @@ init_state_from_metgrid(int lev, FArrayBox& state_fab, * @param NC_MSFM_fab Vector of FArrayBox objects holding metgrid data for z-velocity map factors */ void -init_msfs_from_metgrid(int lev, FArrayBox& msfu_fab, - FArrayBox& msfv_fab, FArrayBox& msfm_fab, - const Vector& NC_MSFU_fab, - const Vector& NC_MSFV_fab, - const Vector& NC_MSFM_fab) +init_msfs_from_metgrid (int lev, FArrayBox& msfu_fab, + FArrayBox& msfv_fab, FArrayBox& msfm_fab, + const Vector& NC_MSFU_fab, + const Vector& NC_MSFV_fab, + const Vector& NC_MSFM_fab) { int nboxes = NC_MSFU_fab.size(); @@ -389,10 +389,10 @@ init_msfs_from_metgrid(int lev, FArrayBox& msfu_fab, * @param NC_PB_fab Vector of FArrayBox objects holding metgrid data specifying pressure */ void -init_base_state_from_metgrid(int lev, const Box& valid_bx, const Real l_rdOcp, - FArrayBox& p_hse, FArrayBox& pi_hse, FArrayBox& r_hse, - const Vector& NC_ALB_fab, - const Vector& NC_PB_fab) +init_base_state_from_metgrid (int lev, const Box& valid_bx, const Real l_rdOcp, + FArrayBox& p_hse, FArrayBox& pi_hse, FArrayBox& r_hse, + const Vector& NC_ALB_fab, + const Vector& NC_PB_fab) { int nboxes = NC_ALB_fab.size(); @@ -433,9 +433,9 @@ init_base_state_from_metgrid(int lev, const Box& valid_bx, const Real l_rdOcp, */ AMREX_GPU_DEVICE void -interpolate_column(int i, int j, int src_comp, int dest_comp, - const Array4& orig_z, const Array4& orig_data, - const Array4& new_z, const Array4& new_data) +interpolate_column (int i, int j, int src_comp, int dest_comp, + const Array4& orig_z, const Array4& orig_data, + const Array4& new_z, const Array4& new_data) { // CAVEAT: we only consider interpolation here - if we go past end of array this won't work for now diff --git a/Source/Initialization/ERF_init_from_wrfinput.cpp b/Source/Initialization/ERF_init_from_wrfinput.cpp index f4336dee0..0bfec76ea 100644 --- a/Source/Initialization/ERF_init_from_wrfinput.cpp +++ b/Source/Initialization/ERF_init_from_wrfinput.cpp @@ -13,82 +13,82 @@ using namespace amrex; #ifdef ERF_USE_NETCDF void -read_from_wrfinput(int lev, const Box& domain, const std::string& fname, - FArrayBox& NC_xvel_fab, FArrayBox& NC_yvel_fab, - FArrayBox& NC_zvel_fab, FArrayBox& NC_rho_fab, - FArrayBox& NC_rhop_fab, FArrayBox& NC_rhotheta_fab, - FArrayBox& NC_MUB_fab , - FArrayBox& NC_MSFU_fab, FArrayBox& NC_MSFV_fab, - FArrayBox& NC_MSFM_fab, FArrayBox& NC_SST_fab, - FArrayBox& NC_C1H_fab , FArrayBox& NC_C2H_fab, - FArrayBox& NC_RDNW_fab, +read_from_wrfinput (int lev, const Box& domain, const std::string& fname, + FArrayBox& NC_xvel_fab, FArrayBox& NC_yvel_fab, + FArrayBox& NC_zvel_fab, FArrayBox& NC_rho_fab, + FArrayBox& NC_rhop_fab, FArrayBox& NC_rhotheta_fab, + FArrayBox& NC_MUB_fab , + FArrayBox& NC_MSFU_fab, FArrayBox& NC_MSFV_fab, + FArrayBox& NC_MSFM_fab, FArrayBox& NC_SST_fab, + FArrayBox& NC_C1H_fab , FArrayBox& NC_C2H_fab, + FArrayBox& NC_RDNW_fab, #if defined(ERF_USE_MOISTURE) - FArrayBox& NC_QVAPOR_fab, - FArrayBox& NC_QCLOUD_fab, - FArrayBox& NC_QRAIN_fab, + FArrayBox& NC_QVAPOR_fab, + FArrayBox& NC_QCLOUD_fab, + FArrayBox& NC_QRAIN_fab, #elif defined(ERF_USE_WARM_NO_PRECIP) #endif - FArrayBox& NC_PH_fab , FArrayBox& NC_PHB_fab, - FArrayBox& NC_ALB_fab , FArrayBox& NC_PB_fab); + FArrayBox& NC_PH_fab , FArrayBox& NC_PHB_fab, + FArrayBox& NC_ALB_fab , FArrayBox& NC_PB_fab); Real -read_from_wrfbdy(const std::string& nc_bdy_file, const Box& domain, - Vector>& bdy_data_xlo, - Vector>& bdy_data_xhi, - Vector>& bdy_data_ylo, - Vector>& bdy_data_yhi, - int& width, amrex::Real& start_bdy_time); +read_from_wrfbdy (const std::string& nc_bdy_file, const Box& domain, + Vector>& bdy_data_xlo, + Vector>& bdy_data_xhi, + Vector>& bdy_data_ylo, + Vector>& bdy_data_yhi, + int& width, amrex::Real& start_bdy_time); void -convert_wrfbdy_data(int which, const Box& domain, - Vector>& bdy_data, - const FArrayBox& NC_MUB_fab, - const FArrayBox& NC_MSFU_fab, - const FArrayBox& NC_MSFV_fab, - const FArrayBox& NC_MSFM_fab, - const FArrayBox& NC_PH_fab, - const FArrayBox& NC_PHB_fab, - const FArrayBox& NC_C1H_fab, - const FArrayBox& NC_C2H_fab, - const FArrayBox& NC_RDNW_fab, - const FArrayBox& NC_xvel_fab, - const FArrayBox& NC_yvel_fab, - const FArrayBox& NC_rho_fab, - const FArrayBox& NC_rhoth_fab); +convert_wrfbdy_data (int which, const Box& domain, + Vector>& bdy_data, + const FArrayBox& NC_MUB_fab, + const FArrayBox& NC_MSFU_fab, + const FArrayBox& NC_MSFV_fab, + const FArrayBox& NC_MSFM_fab, + const FArrayBox& NC_PH_fab, + const FArrayBox& NC_PHB_fab, + const FArrayBox& NC_C1H_fab, + const FArrayBox& NC_C2H_fab, + const FArrayBox& NC_RDNW_fab, + const FArrayBox& NC_xvel_fab, + const FArrayBox& NC_yvel_fab, + const FArrayBox& NC_rho_fab, + const FArrayBox& NC_rhoth_fab); void -init_state_from_wrfinput(int lev, FArrayBox& state_fab, - FArrayBox& x_vel_fab, FArrayBox& y_vel_fab, - FArrayBox& z_vel_fab, +init_state_from_wrfinput (int lev, FArrayBox& state_fab, + FArrayBox& x_vel_fab, FArrayBox& y_vel_fab, + FArrayBox& z_vel_fab, #if defined(ERF_USE_MOISTURE) - const Vector& NC_QVAPOR_fab, - const Vector& NC_QCLOUD_fab, - const Vector& NC_QRAIN_fab, + const Vector& NC_QVAPOR_fab, + const Vector& NC_QCLOUD_fab, + const Vector& NC_QRAIN_fab, #elif defined(ERF_USE_WARM_NO_PRECIP) #endif - const Vector& NC_xvel_fab, - const Vector& NC_yvel_fab, - const Vector& NC_zvel_fab, - const Vector& NC_rho_fab, - const Vector& NC_rhotheta_fab); + const Vector& NC_xvel_fab, + const Vector& NC_yvel_fab, + const Vector& NC_zvel_fab, + const Vector& NC_rho_fab, + const Vector& NC_rhotheta_fab); void -init_msfs_from_wrfinput(int lev, FArrayBox& msfu_fab, - FArrayBox& msfv_fab, FArrayBox& msfm_fab, - const Vector& NC_MSFU_fab, - const Vector& NC_MSFV_fab, - const Vector& NC_MSFM_fab); +init_msfs_from_wrfinput (int lev, FArrayBox& msfu_fab, + FArrayBox& msfv_fab, FArrayBox& msfm_fab, + const Vector& NC_MSFU_fab, + const Vector& NC_MSFV_fab, + const Vector& NC_MSFM_fab); void -init_terrain_from_wrfinput(int lev, const Box& domain, FArrayBox& z_phys, - const Vector& NC_PH_fab, - const Vector& NC_PHB_fab); +init_terrain_from_wrfinput (int lev, const Box& domain, FArrayBox& z_phys, + const Vector& NC_PH_fab, + const Vector& NC_PHB_fab); void -init_base_state_from_wrfinput(int lev, const Box& bx, Real l_rdOcp, - FArrayBox& p_hse, FArrayBox& pi_hse, - FArrayBox& r_hse, - const Vector& NC_ALB_fab, - const Vector& NC_PB_fab); +init_base_state_from_wrfinput (int lev, const Box& bx, Real l_rdOcp, + FArrayBox& p_hse, FArrayBox& pi_hse, + FArrayBox& r_hse, + const Vector& NC_ALB_fab, + const Vector& NC_PB_fab); /** * ERF function that initializes data from a WRF dataset @@ -96,7 +96,7 @@ init_base_state_from_wrfinput(int lev, const Box& bx, Real l_rdOcp, * @param lev Integer specifying the current level */ void -ERF::init_from_wrfinput(int lev) +ERF::init_from_wrfinput (int lev) { // *** FArrayBox's at this level for holding the INITIAL data Vector NC_xvel_fab ; NC_xvel_fab.resize(num_boxes_at_level[lev]); @@ -271,22 +271,22 @@ ERF::init_from_wrfinput(int lev) * @param NC_rhotheta_fab Vector of FArrayBox objects with the WRF dataset specifying density*(potential temperature) */ void -init_state_from_wrfinput(int lev, - FArrayBox& state_fab, - FArrayBox& x_vel_fab, - FArrayBox& y_vel_fab, - FArrayBox& z_vel_fab, +init_state_from_wrfinput (int lev, + FArrayBox& state_fab, + FArrayBox& x_vel_fab, + FArrayBox& y_vel_fab, + FArrayBox& z_vel_fab, #if defined(ERF_USE_MOISTURE) - const Vector& NC_QVAPOR_fab, - const Vector& NC_QCLOUD_fab, - const Vector& NC_QRAIN_fab, + const Vector& NC_QVAPOR_fab, + const Vector& NC_QCLOUD_fab, + const Vector& NC_QRAIN_fab, #elif defined(ERF_USE_WARM_NO_PRECIP) #endif - const Vector& NC_xvel_fab, - const Vector& NC_yvel_fab, - const Vector& NC_zvel_fab, - const Vector& NC_rho_fab, - const Vector& NC_rhotheta_fab) + const Vector& NC_xvel_fab, + const Vector& NC_yvel_fab, + const Vector& NC_zvel_fab, + const Vector& NC_rho_fab, + const Vector& NC_rhotheta_fab) { int nboxes = NC_xvel_fab.size(); for (int idx = 0; idx < nboxes; idx++) @@ -337,11 +337,11 @@ init_state_from_wrfinput(int lev, * @param NC_MSFM_fab Vector of FArrayBoxes holding WRF data specifying z-velocity map factors */ void -init_msfs_from_wrfinput(int lev, FArrayBox& msfu_fab, - FArrayBox& msfv_fab, FArrayBox& msfm_fab, - const Vector& NC_MSFU_fab, - const Vector& NC_MSFV_fab, - const Vector& NC_MSFM_fab) +init_msfs_from_wrfinput (int lev, FArrayBox& msfu_fab, + FArrayBox& msfv_fab, FArrayBox& msfm_fab, + const Vector& NC_MSFU_fab, + const Vector& NC_MSFV_fab, + const Vector& NC_MSFM_fab) { int nboxes = NC_MSFU_fab.size(); for (int idx = 0; idx < nboxes; idx++) @@ -374,10 +374,10 @@ init_msfs_from_wrfinput(int lev, FArrayBox& msfu_fab, * @param NC_PB_fab Vector of FArrayBox objects containing WRF data specifying pressure */ void -init_base_state_from_wrfinput(int lev, const Box& valid_bx, const Real l_rdOcp, - FArrayBox& p_hse, FArrayBox& pi_hse, FArrayBox& r_hse, - const Vector& NC_ALB_fab, - const Vector& NC_PB_fab) +init_base_state_from_wrfinput (int lev, const Box& valid_bx, const Real l_rdOcp, + FArrayBox& p_hse, FArrayBox& pi_hse, FArrayBox& r_hse, + const Vector& NC_ALB_fab, + const Vector& NC_PB_fab) { int nboxes = NC_ALB_fab.size(); for (int idx = 0; idx < nboxes; idx++) @@ -409,9 +409,9 @@ init_base_state_from_wrfinput(int lev, const Box& valid_bx, const Real l_rdOcp, * @param NC_PHB_fab Vector of FArrayBox objects storing WRF terrain coordinate data (PHB) */ void -init_terrain_from_wrfinput(int lev, const Box& domain, FArrayBox& z_phys, - const Vector& NC_PH_fab, - const Vector& NC_PHB_fab) +init_terrain_from_wrfinput (int lev, const Box& domain, FArrayBox& z_phys, + const Vector& NC_PH_fab, + const Vector& NC_PHB_fab) { int nboxes = NC_PH_fab.size(); for (int idx = 0; idx < nboxes; idx++) diff --git a/Source/Initialization/InputSoundingData.H b/Source/Initialization/InputSoundingData.H index 3e292409f..c7d471e3b 100644 --- a/Source/Initialization/InputSoundingData.H +++ b/Source/Initialization/InputSoundingData.H @@ -19,10 +19,10 @@ */ struct InputSoundingData { public: - InputSoundingData() {} + InputSoundingData () {} - void read_from_file(const std::string input_sounding_file, - amrex::Geometry const &geom) + void read_from_file (const std::string input_sounding_file, + amrex::Geometry const &geom) { const amrex::Real zbot = geom.ProbLo(AMREX_SPACEDIM-1); AMREX_ALWAYS_ASSERT(zbot == 0); @@ -121,7 +121,7 @@ public: host_to_device(); } - void calc_rho_p() + void calc_rho_p () { /* Calculate density and pressure, roughly following the procedure in * WRF dyn_em/module_initialize_ideal.F. We integrate hydrostatically @@ -233,7 +233,7 @@ public: host_to_device(); } - void host_to_device() + void host_to_device () { z_inp_sound_d.resize(size()); theta_inp_sound_d.resize(size()); @@ -271,7 +271,7 @@ public: } } - int size() const + int size () const { AMREX_ALWAYS_ASSERT(z_inp_sound.size() == theta_inp_sound.size()); AMREX_ALWAYS_ASSERT(z_inp_sound.size() == qv_inp_sound.size()); diff --git a/Source/TimeIntegration/TI_fast_rhs_fun.H b/Source/TimeIntegration/TI_fast_rhs_fun.H index b5658e2c4..6ee23f68c 100644 --- a/Source/TimeIntegration/TI_fast_rhs_fun.H +++ b/Source/TimeIntegration/TI_fast_rhs_fun.H @@ -140,30 +140,6 @@ auto fast_rhs_fun = [&](int fast_step, int n_sub, } } - - // TODO: DELETE ALL OF THIS; FILL BCs PICKS THIS UP W/O G2E - /* -#ifdef ERF_USE_NETCDF - // Update vars in set zone (relaxation already updated) - if (init_type=="real" && level==0 && wrfbdy_set_width>0) { - if (fast_step == 0 ) { - update_interior_ghost(level, dtau, wrfbdy_set_width, boxes_at_level[level], S_slow_rhs, S_old, S_data); - } else { - update_interior_ghost(level, dtau, wrfbdy_set_width, boxes_at_level[level], S_slow_rhs, S_data, S_data); - } - } -#endif - - // Update vars in set zone (relaxation already updated) - if (level>0 && cf_set_width>0) { - if (fast_step == 0 ) { - update_interior_ghost(level, dtau, cf_set_width, boxes_at_level[level], S_slow_rhs, S_old, S_data, &FPr_c[level-1], &FPr_u[level-1], &FPr_v[level-1], &FPr_w[level-1]); - } else { - update_interior_ghost(level, dtau, cf_set_width, boxes_at_level[level], S_slow_rhs, S_data, S_data, &FPr_c[level-1], &FPr_u[level-1], &FPr_v[level-1], &FPr_w[level-1]); - } - } - */ - // Even if we update all the conserved variables we don't need // to fillpatch the slow ones every acoustic substep bool fast_only = true; diff --git a/Source/Utils/Interpolation_1D.H b/Source/Utils/Interpolation_1D.H index 3bdc3d862..e89b94b6b 100644 --- a/Source/Utils/Interpolation_1D.H +++ b/Source/Utils/Interpolation_1D.H @@ -9,8 +9,8 @@ */ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE -amrex::Real interpolate_1d(const amrex::Real* alpha, const amrex::Real* beta, - const amrex::Real alpha_interp, const int alpha_size) +amrex::Real interpolate_1d (const amrex::Real* alpha, const amrex::Real* beta, + const amrex::Real alpha_interp, const int alpha_size) { using namespace amrex; diff --git a/Source/Utils/Interpolation_UPW.H b/Source/Utils/Interpolation_UPW.H index 8464a7fae..89586d5e2 100644 --- a/Source/Utils/Interpolation_UPW.H +++ b/Source/Utils/Interpolation_UPW.H @@ -8,20 +8,20 @@ */ struct CENTERED2 { - CENTERED2(const amrex::Array4& phi) + CENTERED2 (const amrex::Array4& phi) : m_phi(phi) {} AMREX_GPU_DEVICE AMREX_FORCE_INLINE void - InterpolateInX(const int& i, - const int& j, - const int& k, - const int& qty_index, - amrex::Real& val_hi, - amrex::Real& val_lo, - amrex::Real /*upw_hi*/, - amrex::Real /*upw_lo*/) const + InterpolateInX (const int& i, + const int& j, + const int& k, + const int& qty_index, + amrex::Real& val_hi, + amrex::Real& val_lo, + amrex::Real /*upw_hi*/, + amrex::Real /*upw_lo*/) const { // Data to interpolate on amrex::Real sp1 = m_phi(i+1, j , k , qty_index); @@ -38,14 +38,14 @@ struct CENTERED2 AMREX_GPU_DEVICE AMREX_FORCE_INLINE void - InterpolateInY(const int& i, - const int& j, - const int& k, - const int& qty_index, - amrex::Real& val_hi, - amrex::Real& val_lo, - amrex::Real /*upw_hi*/, - amrex::Real /*upw_lo*/) const + InterpolateInY (const int& i, + const int& j, + const int& k, + const int& qty_index, + amrex::Real& val_hi, + amrex::Real& val_lo, + amrex::Real /*upw_hi*/, + amrex::Real /*upw_lo*/) const { // Data to interpolate on amrex::Real sp1 = m_phi(i , j+1, k , qty_index); @@ -62,12 +62,12 @@ struct CENTERED2 AMREX_GPU_DEVICE AMREX_FORCE_INLINE void - InterpolateInZ_lo(const int& i, - const int& j, - const int& k, - const int& qty_index, - amrex::Real& val_lo, - amrex::Real /*upw_lo*/) const + InterpolateInZ_lo (const int& i, + const int& j, + const int& k, + const int& qty_index, + amrex::Real& val_lo, + amrex::Real /*upw_lo*/) const { // Data to interpolate on amrex::Real s = m_phi(i , j , k , qty_index); @@ -80,12 +80,12 @@ struct CENTERED2 AMREX_GPU_DEVICE AMREX_FORCE_INLINE void - InterpolateInZ_hi(const int& i, - const int& j, - const int& k, - const int& qty_index, - amrex::Real& val_hi, - amrex::Real /*upw_hi*/) const + InterpolateInZ_hi (const int& i, + const int& j, + const int& k, + const int& qty_index, + amrex::Real& val_hi, + amrex::Real /*upw_hi*/) const { // Data to interpolate on amrex::Real sp1 = m_phi(i , j , k+1, qty_index); @@ -118,20 +118,20 @@ private: */ struct UPWIND3 { - UPWIND3(const amrex::Array4& phi) + UPWIND3 (const amrex::Array4& phi) : m_phi(phi) {} AMREX_GPU_DEVICE AMREX_FORCE_INLINE void - InterpolateInX(const int& i, - const int& j, - const int& k, - const int& qty_index, - amrex::Real& val_hi, - amrex::Real& val_lo, - amrex::Real upw_hi, - amrex::Real upw_lo) const + InterpolateInX (const int& i, + const int& j, + const int& k, + const int& qty_index, + amrex::Real& val_hi, + amrex::Real& val_lo, + amrex::Real upw_hi, + amrex::Real upw_lo) const { // Data to interpolate on amrex::Real sp2 = m_phi(i+2, j , k , qty_index); @@ -154,14 +154,14 @@ struct UPWIND3 AMREX_GPU_DEVICE AMREX_FORCE_INLINE void - InterpolateInY(const int& i, - const int& j, - const int& k, - const int& qty_index, - amrex::Real& val_hi, - amrex::Real& val_lo, - amrex::Real upw_hi, - amrex::Real upw_lo) const + InterpolateInY (const int& i, + const int& j, + const int& k, + const int& qty_index, + amrex::Real& val_hi, + amrex::Real& val_lo, + amrex::Real upw_hi, + amrex::Real upw_lo) const { // Data to interpolate on amrex::Real sp2 = m_phi(i , j+2, k , qty_index); @@ -184,12 +184,12 @@ struct UPWIND3 AMREX_GPU_DEVICE AMREX_FORCE_INLINE void - InterpolateInZ_lo(const int& i, - const int& j, - const int& k, - const int& qty_index, - amrex::Real& val_lo, - amrex::Real upw_lo) const + InterpolateInZ_lo (const int& i, + const int& j, + const int& k, + const int& qty_index, + amrex::Real& val_lo, + amrex::Real upw_lo) const { // Data to interpolate on amrex::Real sp1 = m_phi(i , j , k+1, qty_index); @@ -207,12 +207,12 @@ struct UPWIND3 AMREX_GPU_DEVICE AMREX_FORCE_INLINE void - InterpolateInZ_hi(const int& i, - const int& j, - const int& k, - const int& qty_index, - amrex::Real& val_hi, - amrex::Real upw_hi) const + InterpolateInZ_hi (const int& i, + const int& j, + const int& k, + const int& qty_index, + amrex::Real& val_hi, + amrex::Real upw_hi) const { // Data to interpolate on amrex::Real sp2 = m_phi(i , j , k+2, qty_index); @@ -230,11 +230,11 @@ struct UPWIND3 AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real - Evaluate(const amrex::Real& sp1, - const amrex::Real& s, - const amrex::Real& sm1, - const amrex::Real& sm2, - const amrex::Real& upw) const + Evaluate (const amrex::Real& sp1, + const amrex::Real& s, + const amrex::Real& sm1, + const amrex::Real& sm2, + const amrex::Real& upw) const { // Averages and diffs amrex::Real a1 = (s + sm1); @@ -258,20 +258,20 @@ private: */ struct CENTERED4 { - CENTERED4(const amrex::Array4& phi) + CENTERED4 (const amrex::Array4& phi) : m_phi(phi) {} AMREX_GPU_DEVICE AMREX_FORCE_INLINE void - InterpolateInX(const int& i, - const int& j, - const int& k, - const int& qty_index, - amrex::Real& val_hi, - amrex::Real& val_lo, - amrex::Real /*upw_hi*/, - amrex::Real /*upw_lo*/) const + InterpolateInX (const int& i, + const int& j, + const int& k, + const int& qty_index, + amrex::Real& val_hi, + amrex::Real& val_lo, + amrex::Real /*upw_hi*/, + amrex::Real /*upw_lo*/) const { // Data to interpolate on amrex::Real sp2 = m_phi(i+2, j , k , qty_index); @@ -290,14 +290,14 @@ struct CENTERED4 AMREX_GPU_DEVICE AMREX_FORCE_INLINE void - InterpolateInY(const int& i, - const int& j, - const int& k, - const int& qty_index, - amrex::Real& val_hi, - amrex::Real& val_lo, - amrex::Real /*upw_hi*/, - amrex::Real /*upw_lo*/) const + InterpolateInY (const int& i, + const int& j, + const int& k, + const int& qty_index, + amrex::Real& val_hi, + amrex::Real& val_lo, + amrex::Real /*upw_hi*/, + amrex::Real /*upw_lo*/) const { // Data to interpolate on amrex::Real sp2 = m_phi(i , j+2, k , qty_index); @@ -316,12 +316,12 @@ struct CENTERED4 AMREX_GPU_DEVICE AMREX_FORCE_INLINE void - InterpolateInZ_lo(const int& i, - const int& j, - const int& k, - const int& qty_index, - amrex::Real& val_lo, - amrex::Real /*upw_lo*/) const + InterpolateInZ_lo (const int& i, + const int& j, + const int& k, + const int& qty_index, + amrex::Real& val_lo, + amrex::Real /*upw_lo*/) const { // Data to interpolate on amrex::Real sp1 = m_phi(i , j , k+1, qty_index); @@ -336,12 +336,12 @@ struct CENTERED4 AMREX_GPU_DEVICE AMREX_FORCE_INLINE void - InterpolateInZ_hi(const int& i, - const int& j, - const int& k, - const int& qty_index, - amrex::Real& val_hi, - amrex::Real /*upw_hi*/) const + InterpolateInZ_hi (const int& i, + const int& j, + const int& k, + const int& qty_index, + amrex::Real& val_hi, + amrex::Real /*upw_hi*/) const { // Data to interpolate on amrex::Real sp2 = m_phi(i , j , k+2, qty_index); @@ -356,10 +356,10 @@ struct CENTERED4 AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real - Evaluate(const amrex::Real& sp1, - const amrex::Real& s, - const amrex::Real& sm1, - const amrex::Real& sm2) const + Evaluate (const amrex::Real& sp1, + const amrex::Real& s, + const amrex::Real& sm1, + const amrex::Real& sm2) const { // Averages and diffs amrex::Real a1 = (s + sm1); @@ -380,20 +380,20 @@ private: */ struct UPWIND5 { - UPWIND5(const amrex::Array4& phi) + UPWIND5 (const amrex::Array4& phi) : m_phi(phi) {} AMREX_GPU_DEVICE AMREX_FORCE_INLINE void - InterpolateInX(const int& i, - const int& j, - const int& k, - const int& qty_index, - amrex::Real& val_hi, - amrex::Real& val_lo, - amrex::Real upw_hi, - amrex::Real upw_lo) const + InterpolateInX (const int& i, + const int& j, + const int& k, + const int& qty_index, + amrex::Real& val_hi, + amrex::Real& val_lo, + amrex::Real upw_hi, + amrex::Real upw_lo) const { // Data to interpolate on amrex::Real sp3 = m_phi(i+3, j , k , qty_index); @@ -418,14 +418,14 @@ struct UPWIND5 AMREX_GPU_DEVICE AMREX_FORCE_INLINE void - InterpolateInY(const int& i, - const int& j, - const int& k, - const int& qty_index, - amrex::Real& val_hi, - amrex::Real& val_lo, - amrex::Real upw_hi, - amrex::Real upw_lo) const + InterpolateInY (const int& i, + const int& j, + const int& k, + const int& qty_index, + amrex::Real& val_hi, + amrex::Real& val_lo, + amrex::Real upw_hi, + amrex::Real upw_lo) const { // Data to interpolate on amrex::Real sp3 = m_phi(i , j+3, k , qty_index); @@ -450,12 +450,12 @@ struct UPWIND5 AMREX_GPU_DEVICE AMREX_FORCE_INLINE void - InterpolateInZ_lo(const int& i, - const int& j, - const int& k, - const int& qty_index, - amrex::Real& val_lo, - amrex::Real upw_lo) const + InterpolateInZ_lo (const int& i, + const int& j, + const int& k, + const int& qty_index, + amrex::Real& val_lo, + amrex::Real upw_lo) const { // Data to interpolate on amrex::Real sp2 = m_phi(i , j , k+2, qty_index); @@ -475,12 +475,12 @@ struct UPWIND5 AMREX_GPU_DEVICE AMREX_FORCE_INLINE void - InterpolateInZ_hi(const int& i, - const int& j, - const int& k, - const int& qty_index, - amrex::Real& val_hi, - amrex::Real upw_hi) const + InterpolateInZ_hi (const int& i, + const int& j, + const int& k, + const int& qty_index, + amrex::Real& val_hi, + amrex::Real upw_hi) const { // Data to interpolate on amrex::Real sp3 = m_phi(i , j , k+3, qty_index); @@ -500,13 +500,13 @@ struct UPWIND5 AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real - Evaluate(const amrex::Real& sp2, - const amrex::Real& sp1, - const amrex::Real& s, - const amrex::Real& sm1, - const amrex::Real& sm2, - const amrex::Real& sm3, - const amrex::Real& upw) const + Evaluate (const amrex::Real& sp2, + const amrex::Real& sp1, + const amrex::Real& s, + const amrex::Real& sm1, + const amrex::Real& sm2, + const amrex::Real& sm3, + const amrex::Real& upw) const { // Averages and diffs amrex::Real a1 = (s + sm1); @@ -532,20 +532,20 @@ private: */ struct CENTERED6 { - CENTERED6(const amrex::Array4& phi) + CENTERED6 (const amrex::Array4& phi) : m_phi(phi) {} AMREX_GPU_DEVICE AMREX_FORCE_INLINE void - InterpolateInX(const int& i, - const int& j, - const int& k, - const int& qty_index, - amrex::Real& val_hi, - amrex::Real& val_lo, - amrex::Real /*upw_hi*/, - amrex::Real /*upw_lo*/) const + InterpolateInX (const int& i, + const int& j, + const int& k, + const int& qty_index, + amrex::Real& val_hi, + amrex::Real& val_lo, + amrex::Real /*upw_hi*/, + amrex::Real /*upw_lo*/) const { // Data to interpolate on amrex::Real sp3 = m_phi(i+3, j , k , qty_index); @@ -566,14 +566,14 @@ struct CENTERED6 AMREX_GPU_DEVICE AMREX_FORCE_INLINE void - InterpolateInY(const int& i, - const int& j, - const int& k, - const int& qty_index, - amrex::Real& val_hi, - amrex::Real& val_lo, - amrex::Real /*upw_hi*/, - amrex::Real /*upw_lo*/) const + InterpolateInY (const int& i, + const int& j, + const int& k, + const int& qty_index, + amrex::Real& val_hi, + amrex::Real& val_lo, + amrex::Real /*upw_hi*/, + amrex::Real /*upw_lo*/) const { // Data to interpolate on amrex::Real sp3 = m_phi(i , j+3, k , qty_index); @@ -594,12 +594,12 @@ struct CENTERED6 AMREX_GPU_DEVICE AMREX_FORCE_INLINE void - InterpolateInZ_lo(const int& i, - const int& j, - const int& k, - const int& qty_index, - amrex::Real& val_lo, - amrex::Real /*upw_lo*/) const + InterpolateInZ_lo (const int& i, + const int& j, + const int& k, + const int& qty_index, + amrex::Real& val_lo, + amrex::Real /*upw_lo*/) const { // Data to interpolate on amrex::Real sp2 = m_phi(i , j , k+2, qty_index); @@ -616,12 +616,12 @@ struct CENTERED6 AMREX_GPU_DEVICE AMREX_FORCE_INLINE void - InterpolateInZ_hi(const int& i, - const int& j, - const int& k, - const int& qty_index, - amrex::Real& val_hi, - amrex::Real /*upw_hi*/) const + InterpolateInZ_hi (const int& i, + const int& j, + const int& k, + const int& qty_index, + amrex::Real& val_hi, + amrex::Real /*upw_hi*/) const { // Data to interpolate on amrex::Real sp3 = m_phi(i , j , k+3, qty_index); @@ -638,12 +638,12 @@ struct CENTERED6 AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real - Evaluate(const amrex::Real& sp2, - const amrex::Real& sp1, - const amrex::Real& s, - const amrex::Real& sm1, - const amrex::Real& sm2, - const amrex::Real& sm3) const + Evaluate (const amrex::Real& sp2, + const amrex::Real& sp1, + const amrex::Real& s, + const amrex::Real& sm1, + const amrex::Real& sm2, + const amrex::Real& sm3) const { // Averages and diffs amrex::Real a1 = (s + sm1); @@ -666,19 +666,19 @@ private: */ struct UPWINDALL { - UPWINDALL(const amrex::Array4& phi) + UPWINDALL (const amrex::Array4& phi) : m_phi(phi) {} AMREX_GPU_DEVICE AMREX_FORCE_INLINE void - InterpolateInZ_lo(const int& i, - const int& j, - const int& k, - const int& qty_index, - amrex::Real& val_lo, - amrex::Real upw_lo, - const AdvType adv_type) const + InterpolateInZ_lo (const int& i, + const int& j, + const int& k, + const int& qty_index, + amrex::Real& val_lo, + amrex::Real upw_lo, + const AdvType adv_type) const { if (adv_type == AdvType::Centered_2nd) { val_lo = 0.5 * ( m_phi(i,j,k,qty_index) + m_phi(i,j,k-1,qty_index) ); @@ -703,13 +703,13 @@ struct UPWINDALL AMREX_GPU_DEVICE AMREX_FORCE_INLINE void - InterpolateInZ_hi(const int& i, - const int& j, - const int& k, - const int& qty_index, - amrex::Real& val_hi, - amrex::Real upw_hi, - const AdvType adv_type) const + InterpolateInZ_hi (const int& i, + const int& j, + const int& k, + const int& qty_index, + amrex::Real& val_hi, + amrex::Real upw_hi, + const AdvType adv_type) const { if (adv_type == AdvType::Centered_2nd) { val_hi = 0.5 * ( m_phi(i,j,k,qty_index) + m_phi(i,j,k+1,qty_index) ); @@ -734,14 +734,14 @@ struct UPWINDALL AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real - Evaluate(const amrex::Real& sp2, - const amrex::Real& sp1, - const amrex::Real& s, - const amrex::Real& sm1, - const amrex::Real& sm2, - const amrex::Real& sm3, - const amrex::Real& upw, - const AdvType adv_type) const + Evaluate (const amrex::Real& sp2, + const amrex::Real& sp1, + const amrex::Real& s, + const amrex::Real& sm1, + const amrex::Real& sm2, + const amrex::Real& sm3, + const amrex::Real& upw, + const AdvType adv_type) const { // Averages and diffs amrex::Real a1 = (s + sm1); @@ -774,6 +774,5 @@ private: static constexpr amrex::Real g1_5_6=(37.0/60.0); static constexpr amrex::Real g2_5_6=( 2.0/15.0); static constexpr amrex::Real g3_5_6=( 1.0/60.0); - }; #endif diff --git a/Source/Utils/Interpolation_WENO.H b/Source/Utils/Interpolation_WENO.H index 187cd3061..bf9a24f40 100644 --- a/Source/Utils/Interpolation_WENO.H +++ b/Source/Utils/Interpolation_WENO.H @@ -8,20 +8,20 @@ */ struct WENO3 { - WENO3(const amrex::Array4& phi) + WENO3 (const amrex::Array4& phi) : m_phi(phi) {} AMREX_GPU_DEVICE AMREX_FORCE_INLINE void - InterpolateInX(const int& i, - const int& j, - const int& k, - const int& qty_index, - amrex::Real& val_hi, - amrex::Real& val_lo, - amrex::Real upw_hi, - amrex::Real upw_lo) const + InterpolateInX (const int& i, + const int& j, + const int& k, + const int& qty_index, + amrex::Real& val_hi, + amrex::Real& val_lo, + amrex::Real upw_hi, + amrex::Real upw_lo) const { // Data to interpolate on amrex::Real sp2 = m_phi(i+2, j , k , qty_index); @@ -50,14 +50,14 @@ struct WENO3 AMREX_GPU_DEVICE AMREX_FORCE_INLINE void - InterpolateInY(const int& i, - const int& j, - const int& k, - const int& qty_index, - amrex::Real& val_hi, - amrex::Real& val_lo, - amrex::Real upw_hi, - amrex::Real upw_lo) const + InterpolateInY (const int& i, + const int& j, + const int& k, + const int& qty_index, + amrex::Real& val_hi, + amrex::Real& val_lo, + amrex::Real upw_hi, + amrex::Real upw_lo) const { // Data to interpolate on amrex::Real sp2 = m_phi(i , j+2, k , qty_index); @@ -86,12 +86,12 @@ struct WENO3 AMREX_GPU_DEVICE AMREX_FORCE_INLINE void - InterpolateInZ_lo(const int& i, - const int& j, - const int& k, - const int& qty_index, - amrex::Real& val_lo, - amrex::Real upw_lo) const + InterpolateInZ_lo (const int& i, + const int& j, + const int& k, + const int& qty_index, + amrex::Real& val_lo, + amrex::Real upw_lo) const { // Data to interpolate on amrex::Real sp1 = m_phi(i , j , k+1, qty_index); @@ -111,12 +111,12 @@ struct WENO3 AMREX_GPU_DEVICE AMREX_FORCE_INLINE void - InterpolateInZ_hi(const int& i, - const int& j, - const int& k, - const int& qty_index, - amrex::Real& val_hi, - amrex::Real upw_hi) const + InterpolateInZ_hi (const int& i, + const int& j, + const int& k, + const int& qty_index, + amrex::Real& val_hi, + amrex::Real upw_hi) const { // Data to interpolate on amrex::Real sp2 = m_phi(i , j , k+2, qty_index); @@ -136,9 +136,9 @@ struct WENO3 AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real - Evaluate(const amrex::Real& sm1, - const amrex::Real& s , - const amrex::Real& sp1) const + Evaluate (const amrex::Real& sm1, + const amrex::Real& s , + const amrex::Real& sp1) const { // Smoothing factors amrex::Real b1 = (s - sm1) * (s - sm1); @@ -172,20 +172,20 @@ private: */ struct WENO5 { - WENO5(const amrex::Array4& phi) + WENO5 (const amrex::Array4& phi) : m_phi(phi) {} AMREX_GPU_DEVICE AMREX_FORCE_INLINE void - InterpolateInX(const int& i, - const int& j, - const int& k, - const int& qty_index, - amrex::Real& val_hi, - amrex::Real& val_lo, - amrex::Real upw_hi, - amrex::Real upw_lo) const + InterpolateInX (const int& i, + const int& j, + const int& k, + const int& qty_index, + amrex::Real& val_hi, + amrex::Real& val_lo, + amrex::Real upw_hi, + amrex::Real upw_lo) const { // Data to interpolate on amrex::Real sp3 = m_phi(i+3, j , k , qty_index); @@ -216,14 +216,14 @@ struct WENO5 AMREX_GPU_DEVICE AMREX_FORCE_INLINE void - InterpolateInY(const int& i, - const int& j, - const int& k, - const int& qty_index, - amrex::Real& val_hi, - amrex::Real& val_lo, - amrex::Real upw_hi, - amrex::Real upw_lo) const + InterpolateInY (const int& i, + const int& j, + const int& k, + const int& qty_index, + amrex::Real& val_hi, + amrex::Real& val_lo, + amrex::Real upw_hi, + amrex::Real upw_lo) const { // Data to interpolate on amrex::Real sp3 = m_phi(i , j+3, k , qty_index); @@ -254,12 +254,12 @@ struct WENO5 AMREX_GPU_DEVICE AMREX_FORCE_INLINE void - InterpolateInZ_lo(const int& i, - const int& j, - const int& k, - const int& qty_index, - amrex::Real& val_lo, - amrex::Real upw_lo) const + InterpolateInZ_lo (const int& i, + const int& j, + const int& k, + const int& qty_index, + amrex::Real& val_lo, + amrex::Real upw_lo) const { // Data to interpolate on amrex::Real sp2 = m_phi(i , j , k+2, qty_index); @@ -281,12 +281,12 @@ struct WENO5 AMREX_GPU_DEVICE AMREX_FORCE_INLINE void - InterpolateInZ_hi(const int& i, - const int& j, - const int& k, - const int& qty_index, - amrex::Real& val_hi, - amrex::Real upw_hi) const + InterpolateInZ_hi (const int& i, + const int& j, + const int& k, + const int& qty_index, + amrex::Real& val_hi, + amrex::Real upw_hi) const { // Data to interpolate on amrex::Real sp3 = m_phi(i , j , k+3, qty_index); @@ -308,11 +308,11 @@ struct WENO5 AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real - Evaluate(const amrex::Real& sm2, - const amrex::Real& sm1, - const amrex::Real& s , - const amrex::Real& sp1, - const amrex::Real& sp2) const + Evaluate (const amrex::Real& sm2, + const amrex::Real& sm1, + const amrex::Real& s , + const amrex::Real& sp1, + const amrex::Real& sp2) const { // Smoothing factors amrex::Real b1 = c1 * (sm2 - 2.0 * sm1 + s) * (sm2 - 2.0 * sm1 + s) + diff --git a/Source/Utils/Interpolation_WENO_Z.H b/Source/Utils/Interpolation_WENO_Z.H index 9bf368caf..0d77bec86 100644 --- a/Source/Utils/Interpolation_WENO_Z.H +++ b/Source/Utils/Interpolation_WENO_Z.H @@ -8,20 +8,20 @@ */ struct WENO_Z3 { - WENO_Z3(const amrex::Array4& phi) + WENO_Z3 (const amrex::Array4& phi) : m_phi(phi) {} AMREX_GPU_DEVICE AMREX_FORCE_INLINE void - InterpolateInX(const int& i, - const int& j, - const int& k, - const int& qty_index, - amrex::Real& val_hi, - amrex::Real& val_lo, - amrex::Real upw_hi, - amrex::Real upw_lo) const + InterpolateInX (const int& i, + const int& j, + const int& k, + const int& qty_index, + amrex::Real& val_hi, + amrex::Real& val_lo, + amrex::Real upw_hi, + amrex::Real upw_lo) const { // Data to interpolate on amrex::Real sp2 = m_phi(i+2, j , k , qty_index); @@ -50,14 +50,14 @@ struct WENO_Z3 AMREX_GPU_DEVICE AMREX_FORCE_INLINE void - InterpolateInY(const int& i, - const int& j, - const int& k, - const int& qty_index, - amrex::Real& val_hi, - amrex::Real& val_lo, - amrex::Real upw_hi, - amrex::Real upw_lo) const + InterpolateInY (const int& i, + const int& j, + const int& k, + const int& qty_index, + amrex::Real& val_hi, + amrex::Real& val_lo, + amrex::Real upw_hi, + amrex::Real upw_lo) const { // Data to interpolate on amrex::Real sp2 = m_phi(i , j+2, k , qty_index); @@ -86,12 +86,12 @@ struct WENO_Z3 AMREX_GPU_DEVICE AMREX_FORCE_INLINE void - InterpolateInZ_lo(const int& i, - const int& j, - const int& k, - const int& qty_index, - amrex::Real& val_lo, - amrex::Real upw_lo) const + InterpolateInZ_lo (const int& i, + const int& j, + const int& k, + const int& qty_index, + amrex::Real& val_lo, + amrex::Real upw_lo) const { // Data to interpolate on amrex::Real sp1 = m_phi(i , j , k+1, qty_index); @@ -111,12 +111,12 @@ struct WENO_Z3 AMREX_GPU_DEVICE AMREX_FORCE_INLINE void - InterpolateInZ_hi(const int& i, - const int& j, - const int& k, - const int& qty_index, - amrex::Real& val_hi, - amrex::Real upw_hi) const + InterpolateInZ_hi (const int& i, + const int& j, + const int& k, + const int& qty_index, + amrex::Real& val_hi, + amrex::Real upw_hi) const { // Data to interpolate on amrex::Real sp2 = m_phi(i , j , k+2, qty_index); @@ -136,9 +136,9 @@ struct WENO_Z3 AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real - Evaluate(const amrex::Real& sm1, - const amrex::Real& s , - const amrex::Real& sp1) const + Evaluate (const amrex::Real& sm1, + const amrex::Real& s , + const amrex::Real& sp1) const { // Smoothing factors amrex::Real b1 = (s - sm1) * (s - sm1); @@ -173,20 +173,20 @@ private: */ struct WENO_MZQ3 { - WENO_MZQ3(const amrex::Array4& phi) + WENO_MZQ3 (const amrex::Array4& phi) : m_phi(phi) {} AMREX_GPU_DEVICE AMREX_FORCE_INLINE void - InterpolateInX(const int& i, - const int& j, - const int& k, - const int& qty_index, - amrex::Real& val_hi, - amrex::Real& val_lo, - amrex::Real upw_hi, - amrex::Real upw_lo) const + InterpolateInX (const int& i, + const int& j, + const int& k, + const int& qty_index, + amrex::Real& val_hi, + amrex::Real& val_lo, + amrex::Real upw_hi, + amrex::Real upw_lo) const { // Data to interpolate on amrex::Real sp2 = m_phi(i+2, j , k , qty_index); @@ -215,14 +215,14 @@ struct WENO_MZQ3 AMREX_GPU_DEVICE AMREX_FORCE_INLINE void - InterpolateInY(const int& i, - const int& j, - const int& k, - const int& qty_index, - amrex::Real& val_hi, - amrex::Real& val_lo, - amrex::Real upw_hi, - amrex::Real upw_lo) const + InterpolateInY (const int& i, + const int& j, + const int& k, + const int& qty_index, + amrex::Real& val_hi, + amrex::Real& val_lo, + amrex::Real upw_hi, + amrex::Real upw_lo) const { // Data to interpolate on amrex::Real sp2 = m_phi(i , j+2, k , qty_index); @@ -251,12 +251,12 @@ struct WENO_MZQ3 AMREX_GPU_DEVICE AMREX_FORCE_INLINE void - InterpolateInZ_lo(const int& i, - const int& j, - const int& k, - const int& qty_index, - amrex::Real& val_lo, - amrex::Real upw_lo) const + InterpolateInZ_lo (const int& i, + const int& j, + const int& k, + const int& qty_index, + amrex::Real& val_lo, + amrex::Real upw_lo) const { // Data to interpolate on amrex::Real sp1 = m_phi(i , j , k+1, qty_index); @@ -276,12 +276,12 @@ struct WENO_MZQ3 AMREX_GPU_DEVICE AMREX_FORCE_INLINE void - InterpolateInZ_hi(const int& i, - const int& j, - const int& k, - const int& qty_index, - amrex::Real& val_hi, - amrex::Real upw_hi) const + InterpolateInZ_hi (const int& i, + const int& j, + const int& k, + const int& qty_index, + amrex::Real& val_hi, + amrex::Real upw_hi) const { // Data to interpolate on amrex::Real sp2 = m_phi(i , j , k+2, qty_index); @@ -301,9 +301,9 @@ struct WENO_MZQ3 AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real - Evaluate(const amrex::Real& sm1, - const amrex::Real& s , - const amrex::Real& sp1) const + Evaluate (const amrex::Real& sm1, + const amrex::Real& s , + const amrex::Real& sp1) const { // Smoothing factors amrex::Real b1 = (s - sm1) * (s - sm1); @@ -343,20 +343,20 @@ private: */ struct WENO_Z5 { - WENO_Z5(const amrex::Array4& phi) + WENO_Z5 (const amrex::Array4& phi) : m_phi(phi) {} AMREX_GPU_DEVICE AMREX_FORCE_INLINE void - InterpolateInX(const int& i, - const int& j, - const int& k, - const int& qty_index, - amrex::Real& val_hi, - amrex::Real& val_lo, - amrex::Real upw_hi, - amrex::Real upw_lo) const + InterpolateInX (const int& i, + const int& j, + const int& k, + const int& qty_index, + amrex::Real& val_hi, + amrex::Real& val_lo, + amrex::Real upw_hi, + amrex::Real upw_lo) const { // Data to interpolate on amrex::Real sp3 = m_phi(i+3, j , k , qty_index); @@ -387,14 +387,14 @@ struct WENO_Z5 AMREX_GPU_DEVICE AMREX_FORCE_INLINE void - InterpolateInY(const int& i, - const int& j, - const int& k, - const int& qty_index, - amrex::Real& val_hi, - amrex::Real& val_lo, - amrex::Real upw_hi, - amrex::Real upw_lo) const + InterpolateInY (const int& i, + const int& j, + const int& k, + const int& qty_index, + amrex::Real& val_hi, + amrex::Real& val_lo, + amrex::Real upw_hi, + amrex::Real upw_lo) const { // Data to interpolate on amrex::Real sp3 = m_phi(i , j+3, k , qty_index); @@ -425,12 +425,12 @@ struct WENO_Z5 AMREX_GPU_DEVICE AMREX_FORCE_INLINE void - InterpolateInZ_lo(const int& i, - const int& j, - const int& k, - const int& qty_index, - amrex::Real& val_lo, - amrex::Real upw_lo) const + InterpolateInZ_lo (const int& i, + const int& j, + const int& k, + const int& qty_index, + amrex::Real& val_lo, + amrex::Real upw_lo) const { // Data to interpolate on amrex::Real sp2 = m_phi(i , j , k+2, qty_index); @@ -452,12 +452,12 @@ struct WENO_Z5 AMREX_GPU_DEVICE AMREX_FORCE_INLINE void - InterpolateInZ_hi(const int& i, - const int& j, - const int& k, - const int& qty_index, - amrex::Real& val_hi, - amrex::Real upw_hi) const + InterpolateInZ_hi (const int& i, + const int& j, + const int& k, + const int& qty_index, + amrex::Real& val_hi, + amrex::Real upw_hi) const { // Data to interpolate on amrex::Real sp3 = m_phi(i , j , k+3, qty_index); @@ -479,11 +479,11 @@ struct WENO_Z5 AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real - Evaluate(const amrex::Real& sm2, - const amrex::Real& sm1, - const amrex::Real& s , - const amrex::Real& sp1, - const amrex::Real& sp2) const + Evaluate (const amrex::Real& sm2, + const amrex::Real& sm1, + const amrex::Real& s , + const amrex::Real& sp1, + const amrex::Real& sp2) const { // Smoothing factors amrex::Real b1 = c1 * (sm2 - 2.0 * sm1 + s) * (sm2 - 2.0 * sm1 + s) + diff --git a/Source/Utils/TerrainMetrics.cpp b/Source/Utils/TerrainMetrics.cpp index 4fd2ed9ba..4182a92b5 100644 --- a/Source/Utils/TerrainMetrics.cpp +++ b/Source/Utils/TerrainMetrics.cpp @@ -425,9 +425,9 @@ init_terrain_grid (const Geometry& geom, MultiFab& z_phys_nd, amrex::Vector