57#ifdef REMORA_USE_NETCDF
60 amrex::Abort(
"remora.biology_ic_type = netcdf requires a NetCDF build");
92#ifdef REMORA_USE_NETCDF
95 amrex::Abort(
"remora.biology_ic_type = netcdf requires a NetCDF build");
118#pragma omp parallel if (amrex::Gpu::notInLaunchRegion())
124 Box
bx =
mfi.tilebox();
174 auto N =
Geom(
lev).Domain().size()[2]-1;
204 for (
int k=0;
k<=
N;
k++) {
217 for(
int k=0;
k<=
N;
k++) {
226 FillPatch(
lev,
t_new[
lev], *
vec_ubar[
lev],
GetVecOfPtrs(
vec_ubar),
ubar_bc(),
bdy_ubar(),0,
false,
false,0,0,
zero,*
vec_ubar[
lev]);
227 FillPatch(
lev,
t_new[
lev], *
vec_vbar[
lev],
GetVecOfPtrs(
vec_vbar),
vbar_bc(),
bdy_vbar(),0,
false,
false,0,0,
zero,*
vec_vbar[
lev]);
243 for (
int n = 0; n <
NAT; n++) {
247 auto N =
Geom(
lev).Domain().size()[2]-1;
250#pragma omp parallel if (Gpu::notInLaunchRegion())
291#ifdef REMORA_USE_NETCDF
297 amrex::Print() <<
"No remora.nc_clim_coeff_file given; climatology nudging will use "
298 "the constant timescales from remora.tnudg, m2nudg, and m3nudg"
301 amrex::Print() <<
"Calling init_clim_nudg_coeff_from_netcdf \n " << std::endl;
303 amrex::Print() <<
"Climatology weights loaded from netcdf file \n " << std::endl;
311 int nz =
geom[0].Domain().length(2);
326 DistributionMapping
dm(
ba);
375 DistributionMapping
dm(
ba);
constexpr amrex::Real zero
mf_h setVal(geomdata.ProbHi(2))
int ncons
Number of conserved scalars in the state (temperature + salt + passive scalars + biology tracers)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_zeta_full_domain
high resolution initial free surface height (2D)
void init_full_domain_zeta_from_analytic()
Initialize high resolution initial sea surface height from analytic functions.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_fcor
coriolis factor (2D)
void allocate_init_full_domain()
Allocate multifabs for storing full-domain high resolution initial data.
void init_gls_vmix(int lev, SolverChoice solver_choice)
Initialize GLS variables.
void init_biology_from_netcdf(int lev)
Biology initialization from NetCDF file.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_xvel_full_domain
multilevel data container for high res initial x velocities (u in ROMS)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_h
multilevel data container for current step's z velocities (largely unused; W stored separately)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_pm
horizontal scaling factor: 1 / dx (2D)
void init_biology_ic(int lev)
Initialize biology tracers from whichever source remora.biology_ic_type selects. Call after the physi...
amrex::Vector< amrex::MultiFab * > cons_new
multilevel data container for current step's scalar data: temperature, salinity, passive tracer
void init_biology_ic_full_domain()
Full-domain counterpart of init_biology_ic, for the hires_init_level average-down path.
amrex::Gpu::DeviceVector< amrex::Real > s_w
Scaled vertical coordinate (range [0,1]) that transforms to z, defined at w-points (cell faces)
REMORABiology::BiologyModel biology_model
Active biology package.
std::unique_ptr< ProblemBase > prob
Pointer to container of analytical functions for problem definition.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_tke
Turbulent kinetic energy.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_gls
Turbulent generic length scale.
void init_biology_full_domain_from_netcdf()
Full-domain high-res biology initialization from NetCDF file.
void set_grid_scale(int lev)
Set pm and pn arrays and x/y coords on level lev.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Lscale
Vertical mixing turbulent length scale.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Hz
Width of cells in the vertical (z-) direction (3D, Hz in ROMS)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Akt
Vertical diffusion coefficient (3D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_pm_full_domain
horizontal scaling factor: 1 / dx (2D) on whole domain
amrex::Vector< amrex::MultiFab * > yvel_new
multilevel data container for current step's y velocities (v in ROMS)
amrex::Box nc_hires_init_box
Box for the full domain at nc_hires_init_level.
amrex::Gpu::DeviceVector< amrex::Real > s_r
Scaled vertical coordinate (range [0,1]) that transforms to z, defined at rho points (cell centers)
amrex::Vector< amrex::IntVect > cum_ref_ratios
Cumulative refinement ratio between level 0 and level i.
amrex::Vector< amrex::MultiFab * > xvel_new
multilevel data container for current step's x velocities (u in ROMS)
int bdy_zeta() const noexcept
void init_beta_plane_coriolis(int lev)
Calculate Coriolis parameters from beta plane parametrization.
std::string nc_clim_coeff_file
NetCDF climatology coefficient file.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_yvel_full_domain
multilevel data container for high res initial y velocities (v in ROMS)
void calc_stretch_coeffs()
calculate vertical stretch coefficients
void set_zeta_average(int lev)
Set Zt_avg1 to zeta.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_h_full_domain
Bathymetry data on the whole domain at each potential level.
void init_full_domain_from_analytic()
Initialize high resolution initial problem data from analytic functions.
int hires_init_level
Which level the high resolution initialization data is at.
int bdy_vbar() const noexcept
void average_down_with_grow_cells(int lev, amrex::Vector< std::unique_ptr< amrex::MultiFab > > &mf)
Average down from level lev+1 to lev in mf, including grow cells.
amrex::Gpu::DeviceVector< amrex::Real > Cs_r
Stretching coefficients at rho points.
amrex::Vector< amrex::Real > t_new
new time at each level
void init_stretch_coeffs()
initialize and calculate stretch coefficients
static SolverChoice solverChoice
Container for algorithmic choices.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Akk
Turbulent kinetic energy vertical diffusion coefficient.
int bdy_ubar() const noexcept
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_zeta
free surface height (2D)
int ubar_bc() const noexcept
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_vbar
barotropic y velocity (2D)
amrex::Box nc_hires_grid_box
Box for the full domain at nc_hires_grid_level.
amrex::Gpu::DeviceVector< amrex::Real > Cs_w
Stretching coefficients at w points.
void set_2darrays(int lev)
Set 2D momentum arrays from 3D momentum.
void init_analytic(int lev)
Initialize initial problem data from analytic functions.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_ubar
barotropic x velocity (2D)
void init_clim_nudg_coeff_from_netcdf(int lev)
Climatology nudging coefficient initialization from NetCDF file.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_cons_full_domain
multilevel data container for high res initial data: temperature, salinity, passive tracer
void FillPatch(int lev, amrex::Real time, amrex::MultiFab &mf_to_be_filled, amrex::Vector< amrex::MultiFab * > const &mfs, const int bccomp, const int bdy_var_type=BdyVars::null, const int icomp=0, const bool fill_all=true, const bool fill_set=false, const int n_not_fill=0, const int icomp_calc=0, const amrex::Real dt=zero, const amrex::MultiFab &mf_calc=amrex::MultiFab())
Fill a new MultiFab by copying in phi from valid region and filling ghost cells.
int vbar_bc() const noexcept
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_pn_full_domain
horizontal scaling factor: 1 / dy (2D) on whole domain
amrex::Vector< amrex::Vector< std::unique_ptr< amrex::MultiFab > > > vec_nudg_coeff
Climatology nudging coefficients.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_pn
horizontal scaling factor: 1 / dy (2D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Akv
Vertical viscosity coefficient (3D)
REMORABiology::FennelParameters fennel_params
Runtime parameters for the Fennel biology package.
void allocate_bathymetry_grid_vars_full_domain()
Allocate multifabs for storing full-domain bathymetry and grid vars data.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Zt_avg1
Average of the free surface, zeta (2D)
void init_clim_nudg_coeff(int lev)
Wrapper to initialize climatology nudging coefficient.
void init_bathymetry_full_domain_from_analytic()
Full domain bathymetry data initialization from analytic.
int hires_grid_level
Which level the high resolution bathymetry is at.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_yr
y_grid on rho points (2D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Akp
Turbulent length scale vertical diffusion coefficient.
REMORABiology::BiologyICType biology_ic_type
Source of the biology tracer initial condition, independent of remora.ic_type. Default follows ic_typ...
int cons(int icomp) noexcept
bool has_biology(BiologyModel model) noexcept
@ follow_ic_type
default: NetCDF when ic_type is netcdf, else analytic
amrex::Real coriolis_beta
amrex::Vector< amrex::Real > nudg_coeff