9#ifdef REMORA_USE_NETCDF
13#include <AMReX_buildInfo.H>
50#ifdef REMORA_USE_NETCDF
73 if (ParallelDescriptor::IOProcessor()) {
76 const char*
buildgithash = amrex::buildInfoGetBuildGitHash();
77 const char*
buildgitname = amrex::buildInfoGetBuildGitName();
80 amrex::Print() <<
"\n"
84 amrex::Print() <<
"AMReX git hash: " <<
amrex_hash <<
"\n";
90 amrex::Print() <<
"\n";
151 if (ParallelDescriptor::IOProcessor()) {
154 const char*
buildgithash = amrex::buildInfoGetBuildGitHash();
155 const char*
buildgitname = amrex::buildInfoGetBuildGitName();
158 amrex::Print() <<
"\n"
162 amrex::Print() <<
"AMReX git hash: " <<
amrex_hash <<
"\n";
168 amrex::Print() <<
"\n";
227 amrex::Print() <<
"Refinement ratio at level " <<
lev <<
" set to be " <<
232 amrex::Print() <<
"********************************************************************************" << std::endl;
233 amrex::Print() <<
"We don't allow refinement in the vertical -- make sure to set ref_ratio = 1 in z" << std::endl;
234 amrex::Print() <<
"It's possible you set amr.ref_ratio when you meant to set amr.ref_ratio_vect " << std::endl;
235 amrex::Print() <<
"********************************************************************************" << std::endl;
258 cons_names.emplace_back(
"tracer_" + std::to_string(
i));
289 amrex::Print() <<
"\nCoarse STEP " <<
step+1 <<
" starts ..." << std::endl;
314 amrex::Print() <<
"Coarse STEP " <<
step+1 <<
" ends." <<
" TIME = " <<
cur_time
315 <<
" DT = " <<
dt[0] << std::endl;
320 ParallelDescriptor::ReduceRealMax(
dEvolveTime,ParallelDescriptor::IOProcessorNumber());
321 amrex::Print() <<
"Timestep time = " <<
dEvolveTime <<
" seconds." <<
'\n';
328#ifdef AMREX_MEM_PROFILING
330 std::ostringstream
ss;
331 ss <<
"[STEP " <<
step+1 <<
"]";
332 MemProfiler::report(
ss.str());
411#pragma omp parallel if (Gpu::notInLaunchRegion())
444#ifdef REMORA_USE_PARTICLES
469 amrex::Print() <<
"REMORA InitData: driver-managed atm2ocn coupling enabled"
471 <<
" active_contract="
509#ifdef REMORA_USE_MOAB
528 FillPatch(
lev,
t_new[
lev], *
cons_new[
lev],
cons_new,
BCVars::cons_bc,
BdyVars::t, 0,
true,
false,0,0,
zero,*
cons_new[
lev]);
529 FillPatch(
lev,
t_new[
lev], *
xvel_new[
lev],
xvel_new,
xvel_bc(),
BdyVars::u, 0,
true,
false,0,0,
zero,*
xvel_new[
lev]);
530 FillPatch(
lev,
t_new[
lev], *
yvel_new[
lev],
yvel_new,
yvel_bc(),
BdyVars::v, 0,
true,
false,0,0,
zero,*
yvel_new[
lev]);
585 BL_PROFILE(
"REMORA::Construct_REMORAFillPatchers()");
586 amrex::Print() <<
":::Construct_REMORAFillPatchers " <<
lev << std::endl;
641 BL_PROFILE(
"REMORA::Define_REMORAFillPatchers()");
643 amrex::Print() <<
":::Define_REMORAFillPatchers " <<
lev << std::endl;
720#ifdef REMORA_USE_NETCDF
721 amrex::Print() <<
"Calling init_zeta_from_netcdf on level " <<
lev << std::endl;
723 amrex::Print() <<
"Sea surface height loaded from netcdf file \n " << std::endl;
726 amrex::Abort(
"Unknown IC_Type");
763#ifdef REMORA_USE_NETCDF
764 amrex::Print() <<
"Calling init_bathymetry_from_netcdf " << std::endl;
766 amrex::Print() <<
"Bathymetry loaded from netcdf file \n " << std::endl;
767 amrex::Print() <<
"Calling init_grid_vars_from_netcdf " << std::endl;
769 amrex::Print() <<
"Grid variables loaded from netcdf file \n " << std::endl;
772 amrex::Abort(
"Unknown IC_Type");
864 FillPatch(
lev,
t_new[
lev], *
cons_new[
lev],
cons_new,
BCVars::cons_bc,
BdyVars::t, 0,
true,
false,0,0,
zero,*
cons_new[
lev]);
865 FillPatch(
lev,
t_new[
lev], *
xvel_new[
lev],
xvel_new,
xvel_bc(),
BdyVars::u, 0,
true,
false,0,0,
zero,*
xvel_new[
lev]);
866 FillPatch(
lev,
t_new[
lev], *
yvel_new[
lev],
yvel_new,
yvel_bc(),
BdyVars::v, 0,
true,
false,0,0,
zero,*
yvel_new[
lev]);
880#ifdef REMORA_USE_NETCDF
883 amrex::Print() <<
"Calling init_coriolis_from_netcdf " << std::endl;
885 amrex::Print() <<
"Coriolis loaded from netcdf file \n" << std::endl;
892 Abort(
"Don't know this coriolis_type!");
911 Abort(
"Don't know this vertical mixing type");
923 for (
int n = 0; n <
NAT; n++) {
928 for (
int n = 0; n <
NAT; n++) {
965#ifdef REMORA_USE_NETCDF
966 amrex::Print() <<
"Calling init_masks_from_netcdf level " <<
lev << std::endl;
968 amrex::Print() <<
"Masks loaded from netcdf file \n " << std::endl;
1034 Gpu::streamSynchronize();
1049 BL_PROFILE(
"REMORA::check_mask_consistency()");
1074 Box
bx =
mfi.tilebox();
bx.makeSlab(2,0);
1079 auto is_01 = [] (Real v) {
1080 return v == Real(0.0) || v == Real(1.0);
1086 return {
static_cast<Long
>(
bad),
static_cast<Long
>(
bad_h)};
1110 MultiFab
cmsku(amrex::convert(
cba, IntVect(1,0,0)),
dmf, 1, 0);
1111 MultiFab
cmskv(amrex::convert(
cba, IntVect(0,1,0)),
dmf, 1, 0);
1130 Box
bx =
mfi.tilebox();
bx.makeSlab(2,0);
1138 const Long
lzero = 0;
1144 const int ii =
i *
rx;
1145 const int jj =
j *
ry;
1155 return {
static_cast<Long
>(
missed),
1162 Box
ubx =
mfi.nodaltilebox(0);
ubx.makeSlab(2,0);
1166 const int ii =
i *
rx;
1167 const int jj =
j *
ry;
1181 Box
vbx =
mfi.nodaltilebox(1);
vbx.makeSlab(2,0);
1185 const int ii =
i *
rx;
1186 const int jj =
j *
ry;
1205 ParallelDescriptor::ReduceLongSum(
nbad_val);
1206 ParallelDescriptor::ReduceLongSum(
nbad_h);
1207 ParallelDescriptor::ReduceLongSum(
nmissed);
1208 ParallelDescriptor::ReduceLongSum(
ndry_r);
1209 ParallelDescriptor::ReduceLongSum(
ndry_u);
1210 ParallelDescriptor::ReduceLongSum(
ndry_v);
1215 amrex::Print() <<
"Land-sea masks are consistent across " <<
finest_level+1
1216 <<
" level(s)" << std::endl;
1221 std::string
msg =
"Land-sea mask problems:";
1223 msg +=
"\n " + std::to_string(
nbad_val) +
" point(s) where a mask is neither 0 nor 1"
1224 " (psi may also be 2). The plotfile writer decides what to blank by comparing"
1225 " masks against 0 exactly, so a fractional mask silently stops masking.";
1228 msg +=
"\n " + std::to_string(
nbad_h) +
" water point(s) with depth <= 0."
1229 " stretch_transform divides by hc + h, so this is quiet garbage rather than a"
1233 msg +=
"\n " + std::to_string(
nmissed) +
" refined point(s) with no coarse point"
1234 " beneath them, which should be impossible under proper nesting.";
1237 msg +=
"\n " + std::to_string(
ndry_r) +
" coarse water cell(s) with only land"
1241 msg +=
"\n " + std::to_string(
ndry_u) +
" coarse u-face(s) and " +
1242 std::to_string(
ndry_v) +
" v-face(s) that are open with no open fine face"
1243 " beneath them. The coarse grid cannot see a barrier the fine grid resolves."
1244 " Closing the coarse face would contradict the coarsening rule, so move the"
1245 " refined grids off it or coarsen the mask by hand.";
1248 msg +=
"\nThe two-way average-down divides by the number of wet fine points, so these"
1249 " have no value to take.";
1251 msg +=
"\nSet remora.mask_consistency = warn to continue anyway.";
1256 amrex::Print() <<
"WARNING: " <<
msg << std::endl;
1310 Gpu::streamSynchronize();
1327 for (
int l = 0;
l <
lev; ++
l) {
1340 for (
int n = 0; n <
ncons; n++) {
1373 for (
int n = 0; n <
ncons; n++) {
1381 amrex::Gpu::LaunchSafeGuard
lsg(
true);
1395 ParallelDescriptor::ReduceRealMin(
denom_min);
1397 Abort(
"scaled_to_grid: found non-positive pm*pn (grid metrics must be > 0)");
1417 ParallelDescriptor::ReduceRealMax(
grdmax);
1419 Abort(
"scaled_to_grid: grdmax <= 0");
1428 for (
int l = 0;
l <
lev; ++
l) {
1441 amrex::Gpu::copy(amrex::Gpu::hostToDevice,
1448 const Box&
bx =
mfi.validbox();
1476 const Box&
bx =
mfi.validbox();
1503 amrex::Gpu::LaunchSafeGuard
lsg_diag(
true);
1566 if (ParallelDescriptor::IOProcessor() &&
lev == 0)
1568 Print() <<
"\nHorizontal mixing scaled by grid metric\n";
1571 Print() <<
"AMR scaling (linear) lev_scale = " <<
lev_scale <<
"\n";
1573 Print() <<
"visc2(all) min/max = "
1576 Print() <<
"visc2(wet,k=0) min/max = "
1579 Print() <<
"visc2(mask->0) min/max = "
1585 Abort(
"Don't know this horizontal mixing type");
1592 for (
int n = 0; n <
ncons; n++) {
1608#ifdef REMORA_USE_NETCDF
1632#ifdef REMORA_USE_NETCDF
1677 amrex::Abort(
"NetCDF bulk-flux forcing requires building with NetCDF");
1713 const std::unique_ptr<MultiFab>&
mf_lev) -> MultiFab&
1786#ifdef REMORA_USE_NETCDF
1787 amrex::Print() <<
"Reading high resolution land-sea mask" << std::endl;
1789 amrex::Print() <<
"Done reading in high resolution land-sea mask" << std::endl;
1796#ifdef REMORA_USE_NETCDF
1797 amrex::Print() <<
"Reading high resolution bathymetry and grid data" << std::endl;
1800 amrex::Print() <<
"Done reading in high resolution bathymetry and grid data" << std::endl;
1805#ifdef REMORA_USE_NETCDF
1811 amrex::Error(
"NetCDF climatology file name must be provided via input");
1837 amrex::Abort(
"Climatology file " +
fname +
" does not contain '" +
1840 "or turn that flag off.");
1851 amrex::Print() <<
"Calling init_bdry_from_netcdf at level " <<
lev << std::endl;
1853 amrex::Print() <<
"Boundary data loaded from netcdf file \n " << std::endl;
1860 amrex::Error(
"NetCDF forcing file name must be provided via input for surface momentum fluxes");
1879 amrex::Error(
"NetCDF forcing file name must be provided via input for bulk-flux atmospheric forcing");
1961 amrex::Error(
"NetCDF river file name must be provided via input for rivers");
1964 int nz =
dom.length(2);
1976 amrex::Abort(
"River file " +
fname +
" does not contain '" +
field +
1977 "', but river input is enabled for tracer '" +
1996 Abort(
"Not compiled with NetCDF, but remora.ic_type = netcdf reads initial and grid data from file");
2001 Abort(
"Not compiled with NetCDF, but selected boundary conditions require NetCDF");
2004 Abort(
"Not compiled with NetCDF, but using river sources requires NetCDF");
2021#ifdef REMORA_USE_NETCDF
2022 amrex::Print() <<
"Reading high resolution initial data" << std::endl;
2033 amrex::Print() <<
"Done reading in high resolution initial data" << std::endl;
2050#ifdef REMORA_USE_NETCDF
2051 amrex::Print() <<
"Calling init_data_from_netcdf " << std::endl;
2055 amrex::Print() <<
"Initial data loaded from netcdf file \n " << std::endl;
2058 amrex::Abort(
"Unknown IC_Type");
2121 Abort(
"remora.max_step and max_step are both specified. Please use only one!");
2124 Abort(
"remora.stop_time and stop_time are both specified. Please use only one!");
2153#ifndef REMORA_USE_FENNEL_FORT
2155 amrex::Abort(
"remora.use_biology_cpp_answer = 0 selects the ROMS "
2156 "Fennel Fortran bridge, which is not compiled in. "
2157 "Rebuild with USE_FENNEL_FORT=TRUE (GNUmake) or "
2158 "-DREMORA_ENABLE_FENNEL_FORT=ON (CMake).");
2161#ifndef REMORA_USE_BIOLOGY_DIAG
2163 amrex::Abort(
"remora.biology_debug > 0 requests the Fennel parity "
2164 "diagnostics, which are not compiled in. Rebuild with "
2165 "USE_BIOLOGY_DIAG=TRUE (GNUmake) or "
2166 "-DREMORA_ENABLE_BIOLOGY_DIAG=ON (CMake).");
2180 amrex::Abort(
"remora.nscalar must be non-negative");
2191 amrex::Print() <<
"Carrying " <<
nscalar <<
" passive scalar(s) and " <<
nbio
2192 <<
" biology tracer(s), for " <<
ncons <<
" cell-centered components: ";
2213 if (
pp.contains(
"data_log")) {
2228 amrex::Abort(
"remora.file_min_digits must be non-negative");
2231 pp.queryAdd(
"cfl",
cfl);
2240 if (
pp.contains(
"fixed_fast_dt")) {
2241 amrex::Abort(
"remora.fixed_fast_dt has been removed. Set remora.ndtfast (the "
2242 "number of barotropic steps per baroclinic step) instead; it is what "
2243 "fixed_fast_dt was used to infer, as remora.fixed_dt / "
2244 "remora.fixed_fast_dt");
2250 if (
pp.contains(
"fixed_ndtfast_ratio")) {
2251 if (
pp.contains(
"ndtfast")) {
2252 amrex::Abort(
"remora.ndtfast and remora.fixed_ndtfast_ratio are both "
2253 "specified. Please use only remora.ndtfast");
2255 amrex::Print() <<
"WARNING: remora.fixed_ndtfast_ratio is deprecated. "
2256 <<
"Please use remora.ndtfast instead." << std::endl;
2258 pp.queryAdd(
"fixed_ndtfast_ratio",
ndtfast);
2267 if (
pp_amr.contains(
"do_substep")) {
2268 if (
pp.contains(
"do_substep")) {
2269 amrex::Abort(
"remora.do_substep and amr.do_substep are both specified. "
2270 "Please use only remora.do_substep");
2272 amrex::Print() <<
"WARNING: amr.do_substep is deprecated. "
2273 <<
"Please use remora.do_substep instead." << std::endl;
2281 amrex::Print() <<
"WARNING: subcycling refined levels in time is EXPERIMENTAL.\n"
2282 <<
" Multi-level answers are not yet considered production\n"
2283 <<
" quality; check them against a single-level run before\n"
2284 <<
" relying on them. remora.do_substep = 0 selects the older\n"
2285 <<
" lockstep driver instead.\n";
2287 amrex::Print() <<
"NOTE: remora.do_substep = 0 selects the lockstep driver. It cannot\n"
2288 <<
" impose the parent's mass flux at a coarse-fine interface, so\n"
2289 <<
" it conserves volume less well: 2.0e-6 against 2.9e-08 on\n"
2290 <<
" Dogbone. Refinement is EXPERIMENTAL on either driver.\n";
2332 amrex::Abort(
"remora.ndtfast must be a positive integer: it is the number of "
2333 "barotropic steps taken per baroclinic step");
2341 if (
pp.contains(
"use_barotropic")) {
2342 amrex::Abort(
"remora.use_barotropic has been removed. The barotropic (2D) mode is "
2343 "always active; please delete this line from your inputs file");
2367#ifdef REMORA_USE_NETCDF
2375 amrex::Abort(
"remora.chunk_history_file requires remora.steps_per_history_file > 0");
2381 amrex::Print() <<
"User selected plotfile_type = " <<
plotfile_type_str << std::endl;
2382 amrex::Abort(
"Dont know this plotfile_type");
2384#ifndef REMORA_USE_NETCDF
2387 amrex::Abort(
"Please compile with NetCDF in order to enable NetCDF plotfiles");
2391#ifdef REMORA_USE_NETCDF
2405 const std::string
nc_file_names = amrex::Concatenate(
"nc_init_file_",
lev,1);
2430 if (
pp.contains(
"nc_frc_file")) {
2437 if (
pp.contains(
"nc_river_file")) {
2444 if (
pp.contains(
"nc_clim_his_file")) {
2499 amrex::Abort(
"hires_grid_level must be less than or equal to amr.max_level");
2502 amrex::Abort(
"hires_grid_level must be greater than 0; use -1 to specify grid data at level 0");
2506 amrex::Abort(
"hires_init_level must be less than or equal to amr.max_level");
2509 amrex::Abort(
"hires_init_level must be greater than 0; use -1 to specify initial data at level 0");
2511#ifdef REMORA_USE_PARTICLES
2528 amrex::Abort(
"remora.biology_ic_type = netcdf requires remora.ic_type = netcdf: the biology "
2529 "initial data is read from the same files as the physical initial data, and no "
2530 "such file is given for analytic initial conditions. Use "
2531 "remora.biology_ic_type = analytic (or follow) instead.");
2534#ifndef REMORA_USE_NETCDF
2536 amrex::Abort(
"Please compile with NetCDF in order to use remora.ic_type = netcdf");
2545 amrex::Abort(
"remora.ic_type = netcdf requires remora.nc_init_file_0 unless "
2546 "remora.hires_init_level is set");
2550 amrex::Abort(
"remora.ic_type = netcdf or remora.mask_type = netcdf requires "
2551 "remora.nc_grid_file_0 unless remora.hires_grid_level is set");
2555 amrex::Abort(
"remora.coriolis_type = netcdf requires remora.nc_grid_file_0");
2563 amrex::Abort(
"High-resolution initialization with analytic initial conditions requires "
2564 "remora.grid_scale_type = constant");
2621 const IntVect
ixt = (
dir == 0) ? IntVect(1,0,0) : IntVect(0,1,0);
2636 const int im = (
d == 0) ?
i-1 :
i;
2637 const int jm = (
d == 0) ?
j :
j-1;
2641 amrex::ignore_unused(
lev);
2652 MultiFab::Copy(
avg,
edge_c, 0, 0, 1, 0);
2668 return {amrex::Math::abs(Real(
ratio) *
a(
i,
j,
k) -
c(
i,
j,
k)) /
2669 amrex::Math::abs(
c(
i,
j,
k))};
2673 ParallelDescriptor::ReduceRealMax(
worst);
2680 amrex::Print() <<
"CF edge tiling, levels " <<
crse_lev <<
"/" <<
crse_lev+1
2681 <<
": max relative residual on_u " <<
res_u
2682 <<
", om_v " <<
res_v << std::endl;
2686 "REMORA::check_cf_metrics: fine cell edges do not sum to the coarse edge across the "
2687 "coarse-fine interface, so the mass flux set_2d_cf_bcs imposes there cannot be "
2688 "conservative. Raise remora.check_cf_tol only if you know why the grid does this.");
2737 int count =
pp.countval(
"dt_ref_ratio");
2741 pp.queryarr(
"dt_ref_ratio",
nsub, 0, 1);
2749 "remora.dt_ref_ratio must be positive: it divides the parent timestep");
2768 BL_PROFILE(
"REMORA::update_avgdown_masks()");
2785 new MultiFab(amrex::convert(
cba, IntVect(1,0,0)),
dmf, 1, 0));
2787 new MultiFab(amrex::convert(
cba, IntVect(0,1,0)),
dmf, 1, 0));
2813 mf.FillBoundary(
geom.periodicity());
2814 amrex::MultiFab
orig(
mf.boxArray(),
mf.DistributionMap(),
ncomp,
mf.nGrowVect());
2815 amrex::MultiFab::Copy(
orig,
mf, 0, 0,
ncomp,
mf.nGrowVect());
2816 const int di = (
dir == 0) ? 1 : 0;
2817 const int dj = (
dir == 1) ? 1 : 0;
2818 for (amrex::MFIter
mfi(
mf, amrex::TilingIfNotGPU());
mfi.isValid(); ++
mfi) {
2819 const amrex::Box&
bx =
mfi.tilebox();
2820 const auto&
a =
mf.array(
mfi);
2821 const auto&
o =
orig.const_array(
mfi);
2822 const auto&
m =
msk.const_array(
mfi);
2826 amrex::Real
sum = amrex::Real(0.0),
cnt = amrex::Real(0.0);
2827 for (
int t = -1; t <= 1; ++t) {
2829 const amrex::Real
w = amrex::min(amrex::Real(1.0),
m(
ii,
jj,0));
2995 const auto ima =
imask.const_arrays();
3000 Gpu::streamSynchronize();
3024 const IntVect
off = IntVect::TheDimensionVector(
dir);
3027 const Box&
bx =
mfi.tilebox();
3038 Gpu::streamSynchronize();
3075 const Box&
bx =
mfi.tilebox();
3084 REMORAMaskedAvgDown::avgdown_masked(
i,
j,
k,n,
c,
f,
fm,
cm,0,0,
ratio);
3089 REMORAMaskedAvgDown::avgdown_faces_masked(
i,
j,
k,n,
c,
f,
fm,
cm,0,0,
ratio,
face_dir);
3093 Gpu::streamSynchronize();
3127 amrex::coarsen(
j,
ratio[1]),
k, n);
3129 Gpu::streamSynchronize();
3164 if (
lev <=
have) {
continue; }
3183 const IntVect
ndir = (
idir == 0) ? IntVect(1,0,0) : IntVect(0,1,0);
3185 const IntVect
ng =
max(
mskr.nGrowVect() -
ndir, IntVect(0));
3190 const Box&
bx =
mfi.growntilebox();
3236 const int idir = (index_type[0]==1) ? 0 : ((index_type[1]==1) ? 1 : -1);
3257 Gpu::streamSynchronize();
3261 if (index_type[0]==0
and index_type[1]==0) {
3267 }
else if (index_type[0]==1
and index_type[1]==0) {
3273 }
else if (index_type[0]==0
and index_type[1]==1) {
3280 amrex::Abort(
"Unexpected nodality in average_down_with_grow_cells");
3282 Gpu::streamSynchronize();
constexpr amrex::Real two
constexpr amrex::Real bogus_large_value
constexpr amrex::Real one
constexpr amrex::Real fourth
constexpr amrex::Real zero
PlotfileType
plotfile format
mf_h setVal(geomdata.ProbHi(2))
AMREX_ALWAYS_ASSERT(!NSPeriodic||!EWPeriodic)
bool QueryNetCDFHasVars(const std::string &fname, const amrex::Vector< std::string > &var_names)
Helper function for testing whether a file carries every named variable.
std::unique_ptr< ProblemBase > amrex_probinit(const amrex_real *problo, const amrex_real *probhi) AMREX_ATTRIBUTE_WEAK
Function to init the physical bounds of the domain and instantiate a Problem derived from ProblemBase...
A class to hold and interpolate time series data read from a NetCDF file.
static PlotfileType plotfile_type
Native or NetCDF plotfile output.
std::string nc_grid_file_hires
Grid file for high resolution bathymetry.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_mskr_full_domain
Land/sea mask at cell centers on the whole domain at each potential level. Specified at hires_grid_le...
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_EminusP
evaporation minus precipitation [kg/m^2/s], defined at rho-points
ProbCoords prob_coords(int lev) const
Coordinate arrays of level lev, for the prob functions.
amrex::Vector< std::string > nc_riv_file
NetCDF river file(s)
void set_grid_vars_averaged_down(int lev)
Set pm/pn by averaging down from higher-resolution grid.
std::string riv_time_varname
Name of time field for river time.
int foextrap_periodic_bc() const noexcept
amrex::Vector< std::string > nc_clim_his_file
NetCDF climatology history file(s)
int ncons
Number of conserved scalars in the state (temperature + salt + passive scalars + biology tracers)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_mskr_crse_on_fine
the level's rho-, u- and v-masks copied onto the layout of the level above it coarsened,...
double stop_time
Whether max_step was set in the inputs; the default above is not a distinguishable sentinel.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_zeta_full_domain
high resolution initial free surface height (2D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_rv2d
v velocity RHS (2D, includes horizontal and vertical advection)
std::string nc_init_file_hires
Init file for high resolution.
int biology_debug_i
Target column i index for biology_debug = 1.
static amrex::Real fixed_dt
User specified fixed baroclinic time step.
amrex::Real last_plot_file_time
Simulation time when we last output a plotfile.
int zvel_bc() const noexcept
static bool plot_staggered_vels
Whether to write the staggered velocities (not averaged to cell centers)
void init_bathymetry_from_netcdf(int lev)
Bathymetry data initialization from NetCDF file.
void init_bcs()
Read in boundary parameters from input file and set up data structures.
int xvel_bc() const noexcept
void set_zeta_averaged_down(int lev)
Copy over zeta data that has been averaged down from high res.
std::unique_ptr< NCTimeSeries > qair_data_from_file
Data container for specific humidity read from file.
static amrex::Real previousCPUTimeUsed
Accumulator variable for CPU time used thusfar.
amrex::Vector< std::string > cons_names
Names of scalars for plotfile output.
bool running_with_coupling_driver
True once REMORA has received forcing through the coupling driver.
amrex::Vector< std::unique_ptr< amrex::YAFluxRegister > > advflux_reg
array of flux registers for refluxing in multilevel
std::unique_ptr< NCTimeSeries > sustr_data_from_file
Data container for u-component surface momentum flux read from file.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_fcor
coriolis factor (2D)
int cf_print_iface
print the imposed coarse-fine interface velocity at this baroclinic step (-1 = off)....
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.
bool time_interp_flux
interpolate the parent's barotropic mass flux in time at the coarse-fine interface,...
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 set2DPlotVariables(const std::string &pp_plot_var_names_2d)
amrex::Vector< REMORAFillPatcher > FPr_v
Vector over levels of FillPatchers for v (3D)
void init_biology_ic(int lev)
Initialize biology tracers from whichever source remora.biology_ic_type selects. Call after the physi...
void init_zeta_full_domain_from_netcdf()
Full-domain high res sea-surface height data initialization from NetCDF file.
amrex::Vector< amrex::MultiFab * > cons_new
multilevel data container for current step's scalar data: temperature, salinity, passive tracer
static bool write_history_file
Whether to output NetCDF files as a single history file with several time steps.
void init_biology_ic_full_domain()
Full-domain counterpart of init_biology_ic, for the hires_init_level average-down path.
void stretch_transform(int lev)
Calculate vertical stretched coordinates.
std::unique_ptr< NCTimeSeries > rain_data_from_file
Data container for precipitation rate read from file.
void define_flux_register(int lev)
build or rebuild the flux register between lev and lev-1
void init_masks_full_domain_from_netcdf()
Full domain high-res mask data initialization from NetCDF file.
REMORABiology::BiologyModel biology_model
Active biology package.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_vwind
Wind in the v direction, defined at rho-points.
std::unique_ptr< ProblemBase > prob
Pointer to container of analytical functions for problem definition.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_mskr
land/sea mask at cell centers (2D)
void check_mask_consistency()
Check every level pair's masks against each other, and every level's mask values, reporting according...
void Construct_REMORAFillPatchers(int lev)
Construct FillPatchers.
void init_grid_vars_from_netcdf(int lev)
Grid variable initialization from NetCDF file.
static int sum_interval
Diagnostic sum output interval in number of steps.
int history_count
Counter for which time index we are writing to in the netcdf history file.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_rain
precipitation rate [kg/m^2/s]
int do_substep
Whether to substep fine levels in time.
void Evolve()
Advance solution to final time.
void update_nodal_masks(int lev)
Rebuild the u-, v- and psi-point masks from vec_mskr and fill their ghosts.
std::string bdry_time_varname
Default name of time field for boundary data.
amrex::Real plotfile_fill_value
fill value for masked arrays in amrex plotfiles
void ReadCheckpointFile()
read checkpoint file from disk
int biology_debug
Biology diagnostic verbosity: 0 off, 1 target column, 2 all columns. See Source/Biology/Fortran/tag_m...
bool chunk_history_file
Whether to split the netcdf history file into fixed-length chunks.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_sustr
Surface stress in the u direction.
amrex::Real get_t_old(int lev) const
Accessor method for t_old to expose to outside classes.
int yvel_bc() const noexcept
void build_covered_mask(int crse_lev, amrex::MultiFab &covered)
Average one field down a level, weighted by the land/sea mask.
std::unique_ptr< NCTimeSeries > longwave_down_data_from_file
Data container for downward longwave radiation flux read from file.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_ru2d
u velocity RHS (2D, includes horizontal and vertical advection)
amrex::Vector< std::string > datalogname
amrex::Vector< amrex::MultiFab * > zvel_new
multilevel data container for current step's z velocities (largely unused; W stored separately)
void reflux_to(int lev)
apply the lev/lev+1 tracer flux correction onto lev
void set_surface_state(int lev)
Initialize or calculate wind speed and other surface state vars from file or analytic.
void check_cf_metrics(int crse_lev)
check that fine cell edges sum to the coarse edge across an interface
void WriteAtIntermediateTime(int step, amrex::Real cur_time)
Write checkpoint and plotfiles at intermediate point of simulation, if needed.
double start_time
Time of the start of the simulation, in seconds on the model clock.
void init_only(int lev, amrex::Real time)
Init (NOT restart or regrid)
void init_set_vmix(int lev)
Initialize vertical mixing coefficients from file or analytic.
std::unique_ptr< NCTimeSeries > v_clim_data_from_file
Data container for v-velocity climatology data read from file.
std::string clim_u_time_varname
Name of time field for u climatology data.
void set_grid_scale(int lev)
Set pm and pn arrays and x/y coords on level lev.
void set_coriolis(int lev)
Initialize Coriolis factor from file or analytic.
int foextrap_bc() const noexcept
amrex::Vector< REMORAFillPatcher > FPr_u
Vector over levels of FillPatchers for u (3D)
void set_masks_averaged_down(int lev)
Copy this level's land-sea mask out of the full-domain mask that was coarsened down from hires_grid_l...
amrex::Vector< amrex::Vector< amrex::Box > > boxes_at_level
the boxes specified at each level by tagging criteria
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_msku
land/sea mask at x-faces (2D)
std::unique_ptr< NCTimeSeriesRiver > river_source_transportbar
Data container for vertically integrated momentum transport in rivers.
std::array< bool, AtmosState::NumTypes > driver_atmos_state_from_driver
provenance flags for driver-supplied atmospheric forcing lanes
std::string clim_ubar_time_varname
Name of time field for ubar climatology data.
std::unique_ptr< NCTimeSeries > u_clim_data_from_file
Data container for u-velocity climatology data read from file.
std::string check_file
Checkpoint file prefix.
static amrex::Real startCPUTime
Variable for CPU timing.
int cf_flux_pc
distribute the parent's interface mass flux piecewise-constantly over the fine faces under each paren...
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_pm_full_domain
horizontal scaling factor: 1 / dx (2D) on whole domain
amrex::Vector< amrex::MultiFab * > xvel_old
multilevel data container for last step's x velocities (u in ROMS)
int cf_avgdown_perimeter
exclude the coarse-fine perimeter's normal-velocity faces from the fine-to-coarse average,...
void ensure_full_domain_masks(int top_lev)
Make sure the full-domain rho-mask exists on levels 0 through top_lev.
void init_data_from_netcdf(int lev)
Problem initialization from NetCDF file.
void init_masks_from_netcdf(int lev)
Mask data initialization from NetCDF file.
amrex::Vector< amrex::MultiFab * > yvel_new
multilevel data container for current step's y velocities (v in ROMS)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_uwind
Wind in the u direction, defined at rho-points.
void refine_masks_with_grow_cells(int fine_lev)
Inject the full-domain rho-mask from fine_lev-1 onto fine_lev, piecewise constant,...
static bool plot_nodal_data
Whether to write nodal data (Nu_nd) to plotfiles.
int regrid_int
how often each level regrids the higher levels of refinement (after a level advances that many time s...
amrex::Real check_int_time
Checkpoint output interval in seconds.
DriverAtmosForcingMode driver_atmos_forcing_mode
Active atmosphere-to-ocean forcing contract on the most recent driver apply.
void init_scalar_metadata()
Build runtime scalar names after nscalar is known.
int zeta_bc() const noexcept
void Define_REMORAFillPatchers(int lev)
Define FillPatchers.
amrex::Vector< amrex::IntVect > cum_ref_ratios
Cumulative refinement ratio between level 0 and level i.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_visc2_p
Harmonic viscosity defined on the psi points (corners of horizontal grid cells)
amrex::Real plot_int_time
Plotfile output interval in seconds.
amrex::Vector< int > num_files_at_level
how many netcdf input files specified at each level
amrex::Vector< REMORAFillPatcher > FPr_vbar
Vector over levels of FillPatchers for vbar (2D)
void AverageDownTo(int crse_lev)
more flexible version of AverageDown() that lets you average down across multiple levels
int steps_per_history_file
Time steps per netcdf history file. Must be > 0 if chunk_history_file.
void post_timestep(int nstep, amrex::Real time, amrex::Real dt_lev)
Called after every level 0 timestep.
int max_step
maximum number of steps
amrex::Vector< amrex::MultiFab * > zvel_old
multilevel data container for last step's z velocities (largely unused; W stored separately)
std::unique_ptr< NCTimeSeries > svstr_data_from_file
Data container for v-component surface momentum flux read from file.
void coarsen_bathymetry_with_grow_cells(int crse_lev)
Coarsen the full-domain bathymetry from crse_lev+1 onto crse_lev, grow cells included,...
amrex::Vector< std::string > nc_frc_file
NetCDF forcing file(s)
amrex::Vector< int > num_boxes_at_level
how many boxes specified at each level by tagging criteria
amrex::Vector< amrex::MultiFab * > xvel_new
multilevel data container for current step's x velocities (u in ROMS)
void refinement_criteria_setup()
Set refinement criteria.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_mskp
land/sea mask at cell corners (2D)
int Bio_comp
First cons component of the biology block, i.e. Tracer_comp + nscalar. The state is laid out as temp,...
int last_check_file_step
Step when we last output a checkpoint file.
int bdy_zeta() const noexcept
void init_beta_plane_coriolis(int lev)
Calculate Coriolis parameters from beta plane parametrization.
std::string clim_vbar_time_varname
Name of time field for vbar climatology data.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_mskv
land/sea mask at y-faces (2D)
amrex::Vector< int > nsubsteps
How many substeps on each level?
amrex::Vector< std::unique_ptr< REMORAPhysBCFunct > > physbcs
Vector (over level) of functors to apply physical boundary conditions.
void ComputeDt()
a wrapper for estTimeStep()
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_msku_crse_on_fine
void fill_3d_masks(int lev)
Copy maskr to all z levels.
std::unique_ptr< NCTimeSeries > EminusP_data_from_file
Data container for evaporation minus precipitation read from file.
void FillCoarsePatch(int lev, amrex::Real time, amrex::MultiFab *mf_fine, amrex::MultiFab *mf_crse, const int bccomp, const int bdy_var_type=BdyVars::null, const int icomp=0, const bool fill_all=true, const int n_not_fill=0, const int icomp_calc=0, const amrex::Real dt=zero, const amrex::MultiFab &mf_calc=amrex::MultiFab())
fill an entire multifab by interpolating from the coarser level
int plot_int
Plotfile output interval in iterations.
std::unique_ptr< NCTimeSeries > cloud_data_from_file
Data container for cloud cover fraction read from file.
amrex::YAFluxRegister * getAdvFluxReg(int lev)
flux register between lev and lev-1
int nbio
Number of biology tracers, set by the active biology model. Zero when no biology model is active.
void WriteAtFinalTime()
Write checkpoint and plotfiles at end of simulation.
void InitData()
Initialize multilevel data.
void update_avgdown_masks(int crse_lev)
Make sure the coarse masks the average-down kernels read sit on the coarsened layout of level crse_le...
void set3DPlotVariables(const std::string &pp_plot_var_names_3d)
amrex::Vector< int > istep
which step?
void WriteCheckpointFile()
write checkpoint file to disk
std::string nc_clim_coeff_file
NetCDF climatology coefficient file.
void setRecordDataInfo(int i, const std::string &filename)
void set_analytic_vmix(int lev)
Set vertical mixing coefficients from analytic.
void coarsen_masks_with_grow_cells(int crse_lev)
Coarsen the full-domain rho-mask from crse_lev+1 onto crse_lev, grow cells included,...
amrex::Vector< std::string > bdry_time_name_byvar
Name of time fields for boundary data.
static int file_min_digits
Minimum number of digits in plotfile name or chunked history file.
void init_riv_pos_from_netcdf(int lev)
static amrex::Vector< std::string > nc_bdry_file
NetCDF boundary data.
amrex::Vector< REMORAFillPatcher > FPr_Dubar
Vector over levels of FillPatchers for Dubar (2D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_visc2_r
Harmonic viscosity defined on the rho points (centers)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_yvel_full_domain
multilevel data container for high res initial y velocities (v in ROMS)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_svstr
Surface stress in the v direction.
std::unique_ptr< NCTimeSeries > srflx_data_from_file
Data container for shortwave radiation flux read from file.
void set_zeta(int lev)
Initialize zeta from file or analytic.
static amrex::Real change_max
Fraction maximum change in subsequent time steps.
int check_cf_metrics_flag
measure whether fine cell edges tile the coarse ones at a coarse-fine interface, which is what makes ...
void init_zeta_from_netcdf(int lev)
Sea-surface height data initialization from NetCDF file.
void set_zeta_average(int lev)
Set Zt_avg1 to zeta.
void init_coriolis_from_netcdf(int lev)
Coriolis parameter data initialization from NetCDF file.
amrex::Vector< REMORAFillPatcher > FPr_Dvbar
Vector over levels of FillPatchers for Dvbar (2D)
std::string pp_prefix
default prefix for input file parameters
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_h_full_domain
Bathymetry data on the whole domain at each potential level.
void set_bathymetry(int lev)
Initialize bathymetry from file or analytic.
amrex::Vector< amrex::MultiFab * > yvel_old
multilevel data container for last step's y velocities (v in ROMS)
std::unique_ptr< NCTimeSeries > ubar_clim_data_from_file
Data container for ubar climatology data read from file.
void init_full_domain_from_analytic()
Initialize high-resolution initial data, zeta included, from analytic functions.
void init_data_full_domain_from_netcdf()
High resolution roblem initialization from NetCDF file.
void init_ref_ratios()
Reject vertical refinement and accumulate the refinement ratios.
amrex::Vector< REMORAFillPatcher > FPr_c
Vector over levels of FillPatchers for scalars.
int hires_init_level
Which level the high resolution initialization data is at.
amrex::Vector< std::string > clim_cons_time_varname
Vector over cons components of the name of the time field for that tracer's climatology data.
std::unique_ptr< NCTimeSeries > Tair_data_from_file
Data container for air temperature read from file.
int nscalar
Number of passive (dye) scalars carried in the state, beyond temperature and salinity....
std::string clim_v_time_varname
Name of time field for v climatology data.
amrex::Vector< REMORAFillPatcher > FPr_w
Vector over levels of FillPatchers for w.
std::unique_ptr< NCTimeSeries > Uwind_data_from_file
Data container for u-direction wind read from file.
std::unique_ptr< NCTimeSeries > Pair_data_from_file
Data container for air pressure read from file.
int cf_fill_vel_after
re-fill the child's 3D velocity from the parent after the step, so the coarse-fine boundary carries t...
amrex::Vector< amrex::Real > t_new
new time at each level, in seconds since start_time
void init_stretch_coeffs()
initialize and calculate stretch coefficients
void init_bdry_from_netcdf(int lev)
Boundary data initialization from NetCDF file.
static SolverChoice solverChoice
Container for algorithmic choices.
void set_masks(int lev)
Initialize land-sea masks from file or analytic.
void set_zeta_to_Ztavg(int lev, bool apply_eminusp=true)
Set zeta components to be equal to time-averaged Zt_avg1.
bool driver_uses_two_way_coupling
Driver-level direction flag copied in before InitData.
amrex::Vector< amrex::Vector< std::unique_ptr< NCTimeSeriesBoundary > > > boundary_series
Vector over BdyVars of boundary series data containers.
int cf_set_width
Width for fixing values at coarse-fine interface.
int biology_debug_j
Target column j index for biology_debug = 1.
void ReadParameters()
read in some parameters from inputs file
int do_reflux
correct the coarse tracer with the finer level's accumulated advective flux at their interface....
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_ru
u velocity RHS (3D, includes horizontal and vertical advection)
void clear_avgdown_masks(int lev)
Drop the cached average-down masks of every level pair that involves lev.
void sum_integrated_quantities(amrex::Real time)
Integrate conserved quantities for diagnostics.
static int total_nc_plot_file_step
int cf_impose_flux
impose the parent's barotropic mass flux on DUon/DVom at the coarse-fine interface,...
static amrex::Vector< amrex::Vector< std::string > > nc_grid_file
NetCDF grid file.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_longwave_down
Downward longwave radiation.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_zeta
free surface height (2D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_vbar
barotropic y velocity (2D)
void FillCoarsePatchPC(int lev, amrex::Real time, amrex::MultiFab *mf_fine, amrex::MultiFab *mf_crse, const int bccomp, const int bdy_var_type=BdyVars::null, const int icomp=0, const bool fill_all=true, const int n_not_fill=0, const int icomp_calc=0, const amrex::Real dt=zero, const amrex::MultiFab &mf_calc=amrex::MultiFab())
fill an entire multifab by interpolating from the coarser level using the piecewise constant interpol...
bool expand_plotvars_to_unif_rr
whether plotfile variables should be expanded to a uniform refinement ratio
int plot_file_on_restart
Whether to output a plotfile on restart from checkpoint.
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 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(), amrex::Vector< amrex::MultiFab * > const &mfs_crse_old={}, amrex::Vector< amrex::MultiFab * > const &mfs_crse_new={})
Fill a new MultiFab by copying in phi from valid region and filling ghost cells.
void restore_perimeter_faces(const amrex::MultiFab &saved, amrex::MultiFab &mf, const amrex::MultiFab &covered, int dir, int ncomp)
put back the coarse normal-velocity faces on the fine patch's perimeter
amrex::Vector< amrex::MultiFab * > cons_old
multilevel data container for last step's scalar data: temperature, salinity, passive tracer
std::string frc_time_varname
Name of time field for forcing data.
amrex::Vector< REMORAFillPatcher > FPr_ubar
Vector over levels of FillPatchers for ubar (2D)
bool is_it_time_for_action(int nstep, amrex::Real time, amrex::Real dt, int action_interval, amrex::Real action_per)
Decide if it is time to take an action.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_cons_full_domain
multilevel data container for high res initial data: temperature, salinity, passive tracer
std::unique_ptr< NCTimeSeries > Vwind_data_from_file
Data container for v-direction wind read from file.
static constexpr bool DriverUsesStateForcing(DriverAtmosForcingMode mode) noexcept
static int ndtfast
User specified, number of barotropic steps per baroclinic step.
void init_bathymetry_full_domain_from_netcdf()
Full domain high-res bathymetry data initialization from NetCDF file.
amrex::Vector< std::unique_ptr< NCTimeSeries > > cons_clim_data_from_file
Vector over cons components of climatology data read from file.
void set_hmixcoef(int lev)
Initialize horizontal mixing coefficients.
amrex::Vector< std::unique_ptr< NCTimeSeriesRiver > > river_source_cons
Vector of data containers for scalar data in rivers.
void timeStep(int lev, amrex::Real time, int iteration)
advance a level by dt, includes a recursive call for finer levels
std::unique_ptr< NCTimeSeriesRiver > river_source_transport
Data container for momentum transport in rivers.
int cf_time_interp_zeta
interpolate the parent in time onto the child's own sub-time, as put_refine2d does,...
void init_grid_vars_full_domain_from_netcdf()
Full domain high-res grid variable initialization from NetCDF file.
void AverageDown()
set covered coarse cells to be the average of overlying fine cells
amrex::Real netcdf_fill_value
fill value for masked arrays in netcdf output
void set_nsubsteps(int nlevs_max)
size nsubsteps and set how many steps each level takes per parent step
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_pn_full_domain
horizontal scaling factor: 1 / dy (2D) on whole domain
void timeStepML(amrex::Real time, int iteration)
advance all levels by dt, loops over finer levels
void print_timestep_hierarchy() const
report the per-level slow/fast timestep hierarchy; call after ComputeDt
const amrex::DistributionMapping & full_domain_dmap()
The shared full-domain DistributionMapping, built on first use.
int cf_avgdown_stencil
average the fine velocity onto the coarse over ROMS's nine-point stencil (fine2coarse2d,...
int cf_set_2d_bcs
0 = never impose the 2D coarse-fine interface condition, 1 = every fast step, 2 = only the first fast...
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_pn
horizontal scaling factor: 1 / dy (2D)
amrex::Vector< std::unique_ptr< std::fstream > > datalog
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Akv
Vertical viscosity coefficient (3D)
static amrex::Real cfl
CFL condition.
void init_masks_full_domain_from_analytic()
Full domain land-sea mask initialization from analytic.
void append3DPlotVariables(const std::string &pp_plot_var_names_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_mskv_crse_on_fine
amrex::Real elapsed_time(double time) const noexcept
Elapsed time since start_time of a time on the model clock.
void set_init_data_averaged_down(int lev)
Problem initialization from averaged-down high resolution data.
static int verbose
Verbosity level of output.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_cloud
cloud cover fraction [0-1], defined at rho-points
std::string plot_file_name
Plotfile prefix.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Zt_avg1
Average of the free surface, zeta (2D)
int check_int
Checkpoint output interval in iterations.
amrex::Real check_cf_tol
tolerance for the above
void set_smflux(int lev)
Initialize or calculate surface momentum flux from file or analytic.
void WritePlotFile(int istep)
main driver for writing AMReX plotfiles
std::string restart_chkfile
If set, restart from this checkpoint file.
void average_down_with_grow_cells(int lev, amrex::Vector< std::unique_ptr< amrex::MultiFab > > &mf, bool use_mask=false)
Average down from level lev+1 to lev in mf, including grow cells.
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.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_rv
v velocity RHS (3D, includes horizontal and vertical advection)
int cf_width
Nudging width at coarse-fine interface.
static amrex::Vector< amrex::Vector< std::string > > nc_init_file
NetCDF initialization file.
int last_plot_file_step
Step when we last output a plotfile.
int use_biology_cpp_answer
Select the native C++ biology kernel (1) or the ROMS Fortran bridge oracle (0). Only meaningful when ...
amrex::Vector< amrex::Real > t_old
old time at each level, in seconds since start_time
double model_time(amrex::Real elapsed) const noexcept
Time on the model clock, in seconds, of an elapsed time such as t_new.
int cf_fill_all_kcomp
write every leapfrog record of the coarse-fine ghost band, as put_refine2d does when it sets zeta(:,...
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_srflx
Shortwave radiation flux [W/m²], defined at rho-points.
amrex::Real last_check_file_time
Simulation time when we last output a checkpoint file.
static amrex::Vector< REMORAErrorTag > ref_tags
Holds info for dynamically generated tagging criteria.
void append2DPlotVariables(const std::string &pp_plot_var_names_2d)
void set_bathymetry_averaged_down(int lev)
Copy over bathymetry data that has been averaged down from high resolution input netcdf file.
amrex::Vector< amrex::Real > dt
time step at each level
static amrex::Real sum_per
Diagnostic sum output interval in time.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Pair
Air pressure [mb], defined at rho-points.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_qair
Specific humidity [kg/kg], defined at rho-points.
int hires_grid_level
Which level the high resolution bathymetry is at.
int reflux_clamp
stop that correction driving a tracer negative, as ROMS does. On by default to match ROMS; costs exac...
std::unique_ptr< NCTimeSeries > vbar_clim_data_from_file
Data container for vbar climatology data read from file.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Tair
Air temperature [°C], defined at rho-points.
void average_down_masked(int crse_lev, const amrex::MultiFab &S_fine, amrex::MultiFab &S_crse, const amrex::MultiFab &msk_fine, const amrex::MultiFab &cmsk, int ncomp, int face_dir)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_diff2
Harmonic diffusivity for temperature / salinity.
REMORABiology::BiologyICType biology_ic_type
Source of the biology tracer initial condition, independent of remora.ic_type. Default follows ic_typ...
@ Pair
atmospheric pressure [Pa from driver, mb in REMORA]
@ Vwind
10-m meridional wind [m/s]
@ Qair
specific humidity [kg/kg]
@ SWrad
downward shortwave radiation [W/m^2]
@ LWrad
downward longwave radiation [W/m^2]
@ Uwind
10-m zonal wind [m/s]
@ Rain
precipitation rate [kg/m^2/s]
@ Cloud
cloud fraction [0-1]
@ Tair
air temperature [K from driver, degC in REMORA]
static constexpr int cons_bc
static constexpr int Temp_bc_comp
static constexpr int t
cons component Temp_comp
int NumTypes(int ncons) noexcept
int vbar(int ncons) noexcept
int cons(int icomp) noexcept
static constexpr int null
int zeta(int ncons) noexcept
int ubar(int ncons) noexcept
@ Vwind
10-m meridional wind [m/s]
@ Pair
atmospheric pressure [mb]
@ Uwind
10-m zonal wind [m/s]
@ LWrad
longwave radiation [W/m^2]
@ Tair
air temperature [degC]
@ Qair
specific humidity or relative humidity [kg/kg or fraction]
@ Cloud
cloud fraction [0-1]
@ SWrad
downward shortwave radiation [W/m^2]
@ Rain
precipitation rate [kg/m^2/s]
@ EminusP
evaporation minus precipitation [m/s]
Vector< std::string > tracer_names(BiologyModel model, FennelParameters const &fennel_parameters)
std::string biology_ic_type_name(BiologyICType type)
bool has_biology(BiologyModel model) noexcept
BiologyICType parse_biology_ic_type(const std::string &name)
BiologyModel parse_biology_model(const std::string &name)
std::string biology_model_name(BiologyModel model)
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void avgdown_faces_masked(int i, int j, int k, int n, amrex::Array4< amrex::Real > const &crse, amrex::Array4< amrex::Real const > const &fine, amrex::Array4< amrex::Real const > const &fmsk, amrex::Array4< amrex::Real const > const &cmsk, int ccomp, int fcomp, amrex::IntVect const &ratio, int idir) noexcept
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void avgdown_masked(int i, int j, int k, int n, amrex::Array4< amrex::Real > const &crse, amrex::Array4< amrex::Real const > const &fine, amrex::Array4< amrex::Real const > const &fmsk, amrex::Array4< amrex::Real const > const &cmsk, int ccomp, int fcomp, amrex::IntVect const &ratio) noexcept
const char * buildInfoGetGitHash(int i)
void init_params(const std::string &remora_prefix)
amrex::Vector< amrex::Real > Akt_bak
HorizMixingType horiz_mixing_type
bool do_check_mask_consistency
amrex::Vector< amrex::Real > tnu2
std::string longwave_netcdf_varname
amrex::Vector< int > do_rivers_cons
ScaledToGridAMRScaling scaled_to_grid_amr_scaling
MaskConsistency mask_consistency
bool boundary_from_netcdf
void init_params(int ncons, int nscalar, const amrex::Vector< std::string > &cons_names)
read in and initialize parameters
VertMixingType vert_mixing_type
std::array< BulkForcingType, BulkFlux::NumTypes > bulk_flux_type
GridScaleType grid_scale_type
amrex::Vector< int > do_cons_clim_nudg
CouplingType coupling_type