12#ifdef REMORA_USE_NETCDF
17 FArrayBox& NC_temp_fab, FArrayBox& NC_salt_fab,
18 FArrayBox& NC_xvel_fab, FArrayBox& NC_yvel_fab);
23 FArrayBox& NC_mskr_fab, FArrayBox& NC_msku_fab,
24 FArrayBox& NC_mskv_fab);
29 Vector<Vector<FArrayBox>>& bdy_data_xlo,
30 Vector<Vector<FArrayBox>>& bdy_data_xhi,
31 Vector<Vector<FArrayBox>>& bdy_data_ylo,
32 Vector<Vector<FArrayBox>>& bdy_data_yhi,
33 int& width, amrex::Real& start_bdy_time,
34 std::string bdry_time_varname,
40 FArrayBox& temp_fab, FArrayBox& salt_fab,
41 FArrayBox& x_vel_fab, FArrayBox& y_vel_fab,
42 const Vector<FArrayBox>& NC_temp_fab,
43 const Vector<FArrayBox>& NC_salt_fab,
44 const Vector<FArrayBox>& NC_xvel_fab,
45 const Vector<FArrayBox>& NC_yvel_fab);
55 FArrayBox& NC_pm_fab, FArrayBox& NC_pn_fab,
56 FArrayBox& NC_xr_fab, FArrayBox& NC_yr_fab,
57 FArrayBox& NC_xu_fab, FArrayBox& NC_yu_fab,
58 FArrayBox& NC_xv_fab, FArrayBox& NC_yv_fab,
59 FArrayBox& NC_xp_fab, FArrayBox& NC_yp_fab);
64 FArrayBox& NC_h_fab, IntVect ngrow);
69 FArrayBox& NC_pm_fab, FArrayBox& NC_pn_fab,
79 FArrayBox& NC_zeta_fab);
86 bool do_temp_clim_nudg,
87 bool do_salt_clim_nudg,
88 FArrayBox& NC_M2NC_fab,
89 FArrayBox& NC_M3NC_fab,
90 FArrayBox& NC_TempNC_fab,
91 FArrayBox& NC_SaltNC_fab);
94void read_vec_from_netcdf (
int lev,
const amrex::Vector<std::string>& fnames,
const std::string& field_name, amrex::Vector<int>& vec_dat);
111 NC_temp_fab[idx], NC_salt_fab[idx],
112 NC_xvel_fab[idx], NC_yvel_fab[idx]);
120#pragma omp parallel if (amrex::Gpu::notInLaunchRegion())
124 for ( MFIter mfi(*
cons_new[lev],
false); mfi.isValid(); ++mfi )
127 FArrayBox &temp_fab = mf_temp[mfi];
128 FArrayBox &salt_fab = mf_salt[mfi];
129 FArrayBox &xvel_fab = (*
xvel_new[lev])[mfi];
130 FArrayBox &yvel_fab = (*
yvel_new[lev])[mfi];
134 NC_temp_fab, NC_salt_fab,
135 NC_xvel_fab, NC_yvel_fab);
159#pragma omp parallel if (amrex::Gpu::notInLaunchRegion())
163 for ( MFIter mfi(*
cons_new[lev],
false); mfi.isValid(); ++mfi )
165 FArrayBox &zeta_fab = (*
vec_zeta[lev])[mfi];
172 zeta_fab.template copy<RunOn::Device>(NC_zeta_fab[idx],0,0,1);
177 vec_zeta[lev]->FillBoundary(geom[lev].periodicity());
178 (*
physbcs[lev])(*
vec_zeta[lev],*
vec_mskr[lev].get(),0,1,
vec_zeta[lev]->nGrowVect(),
t_new[lev],
zeta_bc(),0,*
vec_zeta[lev],*
vec_msku[lev],*
vec_mskv[lev]);
183 Real told =
t_new[lev];
189 0,
false,
false,0,0,0.0,*
vec_zeta[lev]);
217 NC_pm_fab[idx], NC_pn_fab[idx],
218 NC_xr_fab[idx], NC_yr_fab[idx],
219 NC_xu_fab[idx], NC_yu_fab[idx],
220 NC_xv_fab[idx], NC_yv_fab[idx],
221 NC_xp_fab[idx], NC_yp_fab[idx]);
224#pragma omp parallel if (amrex::Gpu::notInLaunchRegion())
228 for ( MFIter mfi(*
cons_new[lev],
false); mfi.isValid(); ++mfi )
230 FArrayBox &pm_fab = (*
vec_pm[lev])[mfi];
231 FArrayBox &pn_fab = (*
vec_pn[lev])[mfi];
232 FArrayBox &xr_fab = (*
vec_xr[lev])[mfi];
233 FArrayBox &yr_fab = (*
vec_yr[lev])[mfi];
234 FArrayBox &xu_fab = (*
vec_xu[lev])[mfi];
235 FArrayBox &yu_fab = (*
vec_yu[lev])[mfi];
236 FArrayBox &xv_fab = (*
vec_xv[lev])[mfi];
237 FArrayBox &yv_fab = (*
vec_yv[lev])[mfi];
238 FArrayBox &xp_fab = (*
vec_xp[lev])[mfi];
239 FArrayBox &yp_fab = (*
vec_yp[lev])[mfi];
246 pm_fab.template copy<RunOn::Device>(NC_pm_fab[idx]);
247 pn_fab.template copy<RunOn::Device>(NC_pn_fab[idx]);
249 xr_fab.template copy<RunOn::Device>(NC_xr_fab[idx]);
250 yr_fab.template copy<RunOn::Device>(NC_yr_fab[idx]);
251 xu_fab.template copy<RunOn::Device>(NC_xu_fab[idx]);
252 yu_fab.template copy<RunOn::Device>(NC_yu_fab[idx]);
253 xv_fab.template copy<RunOn::Device>(NC_xv_fab[idx]);
254 yv_fab.template copy<RunOn::Device>(NC_yv_fab[idx]);
255 xp_fab.template copy<RunOn::Device>(NC_xp_fab[idx]);
256 yp_fab.template copy<RunOn::Device>(NC_yp_fab[idx]);
261 Real dummy_time = 0.0_rt;
272 int ng =
vec_pm[lev]->nGrow();
274 const auto& dom_lo = amrex::lbound(geom[lev].Domain());
275 const auto& dom_hi = amrex::ubound(geom[lev].Domain());
284 vec_pm[lev]->FillBoundary(geom[lev].periodicity());
285 vec_pn[lev]->FillBoundary(geom[lev].periodicity());
287 vec_xr[lev]->FillBoundary(geom[lev].periodicity());
288 vec_yr[lev]->FillBoundary(geom[lev].periodicity());
289 vec_xu[lev]->FillBoundary(geom[lev].periodicity());
290 vec_yu[lev]->FillBoundary(geom[lev].periodicity());
291 vec_xv[lev]->FillBoundary(geom[lev].periodicity());
292 vec_yv[lev]->FillBoundary(geom[lev].periodicity());
293 vec_xp[lev]->FillBoundary(geom[lev].periodicity());
294 vec_yp[lev]->FillBoundary(geom[lev].periodicity());
296 for ( MFIter mfi(*
vec_pm[lev]); mfi.isValid(); ++mfi )
298 Box bx = mfi.tilebox();
300 auto pm_fab =
vec_pm[lev]->array(mfi);
301 auto pn_fab =
vec_pn[lev]->array(mfi);
303 Box gbx_lox = adjCellLo(bx,0,ng); gbx_lox.grow(1,ng); gbx_lox.setBig (0,dom_lo.x-2);
304 Box gbx_hix = adjCellHi(bx,0,ng); gbx_hix.grow(1,ng); gbx_hix.setSmall(0,dom_hi.x+2);
305 Box gbx_loy = adjCellLo(bx,1,ng); gbx_loy.grow(0,ng); gbx_loy.setBig (1,dom_lo.y-2);
306 Box gbx_hiy = adjCellHi(bx,1,ng); gbx_hiy.grow(0,ng); gbx_hiy.setSmall(1,dom_hi.y+2);
314 ParallelFor(gbx_lox, [=] AMREX_GPU_DEVICE (
int i,
int j,
int k)
316 pm_fab(i,j,k,0) = pm_fab(dom_lo.x-1,j,k,0);
317 pn_fab(i,j,k,0) = pn_fab(dom_lo.x-1,j,k,0);
321 ParallelFor(gbx_hix, [=] AMREX_GPU_DEVICE (
int i,
int j,
int k)
323 pm_fab(i,j,k,0) = pm_fab(dom_hi.x+1,j,k,0);
324 pn_fab(i,j,k,0) = pn_fab(dom_hi.x+1,j,k,0);
328 ParallelFor(gbx_loy, [=] AMREX_GPU_DEVICE (
int i,
int j,
int k)
330 pm_fab(i,j,k,0) = pm_fab(i,dom_lo.y-1,k,0);
331 pn_fab(i,j,k,0) = pn_fab(i,dom_lo.y-1,k,0);
335 ParallelFor(gbx_hiy, [=] AMREX_GPU_DEVICE (
int i,
int j,
int k)
337 pm_fab(i,j,k,0) = pm_fab(i,dom_hi.y+1,k,0);
338 pn_fab(i,j,k,0) = pn_fab(i,dom_hi.y+1,k,0);
357#pragma omp parallel if (amrex::Gpu::notInLaunchRegion())
361 for ( MFIter mfi(*
cons_new[lev],
false); mfi.isValid(); ++mfi )
363 FArrayBox &h_fab = (*
vec_h[lev])[mfi];
371 h_fab.template copy<RunOn::Device>(NC_h_fab[idx],0,0,1);
372 h_fab.template copy<RunOn::Device>(NC_h_fab[idx],0,1,1);
377 const double dummy_time = 0.0_rt;
387 vec_h[lev]->FillBoundary(geom[lev].periodicity());
405#pragma omp parallel if (amrex::Gpu::notInLaunchRegion())
409 for ( MFIter mfi(*
cons_new[lev],
false); mfi.isValid(); ++mfi )
411 FArrayBox &fcor_fab = (*
vec_fcor[lev])[mfi];
418 fcor_fab.template copy<RunOn::Device>(NC_fcor_fab[idx]);
422 vec_fcor[lev]->FillBoundary(geom[lev].periodicity());
439 NC_mskr_fab[idx],NC_msku_fab[idx],
443#pragma omp parallel if (amrex::Gpu::notInLaunchRegion())
447 for ( MFIter mfi(*
cons_new[lev],
false); mfi.isValid(); ++mfi )
449 FArrayBox &mskr_fab = (*
vec_mskr[lev])[mfi];
450 FArrayBox &msku_fab = (*
vec_msku[lev])[mfi];
451 FArrayBox &mskv_fab = (*
vec_mskv[lev])[mfi];
458 mskr_fab.template copy<RunOn::Device>(NC_mskr_fab[idx]);
459 msku_fab.template copy<RunOn::Device>(NC_msku_fab[idx]);
460 mskv_fab.template copy<RunOn::Device>(NC_mskv_fab[idx]);
466 vec_mskr[lev]->FillBoundary(geom[lev].periodicity());
467 vec_msku[lev]->FillBoundary(geom[lev].periodicity());
468 vec_mskv[lev]->FillBoundary(geom[lev].periodicity());
469 vec_mskp[lev]->FillBoundary(geom[lev].periodicity());
479 amrex::Error(
"NetCDF boundary file name must be provided via input");
482 amrex::Vector<std::string> field_name = {
"u",
"v",
"temp",
"salt",
"ubar",
"vbar",
"zeta"};
483 amrex::Vector<IntVect > index_types = {IntVect(1,0,0), IntVect(0,1,0),
484 IntVect(0,0,0), IntVect(0,0,0),
485 IntVect(1,0,0), IntVect(0,1,0),
487 std::vector<bool > is_2d = {
false,
false,
false,
false,
true,
true,
true};
489 amrex::Print() <<
"DOING INIT AT LEVEL " << lev << std::endl;
490 int rx = 1;
int ry = 1;
492 for (
int k = lev-1; k >= 0; k--) {
493 rx *= ref_ratio[k][0];
494 ry *= ref_ratio[k][1];
522 FArrayBox& temp_fab, FArrayBox& salt_fab,
523 FArrayBox& x_vel_fab, FArrayBox& y_vel_fab,
524 const Vector<FArrayBox>& NC_temp_fab,
525 const Vector<FArrayBox>& NC_salt_fab,
526 const Vector<FArrayBox>& NC_xvel_fab,
527 const Vector<FArrayBox>& NC_yvel_fab)
529 int nboxes = NC_xvel_fab.size();
530 for (
int idx = 0; idx < nboxes; idx++)
536 temp_fab.template copy<RunOn::Device>(NC_temp_fab[idx]);
537 salt_fab.template copy<RunOn::Device>(NC_salt_fab[idx]);
538 x_vel_fab.template copy<RunOn::Device>(NC_xvel_fab[idx]);
539 y_vel_fab.template copy<RunOn::Device>(NC_yvel_fab[idx]);
562 NC_M2NC_fab[idx],NC_M3NC_fab[idx],
563 NC_TempNC_fab[idx],NC_SaltNC_fab[idx]);
566#pragma omp parallel if (amrex::Gpu::notInLaunchRegion())
570 for ( MFIter mfi(*
cons_new[lev],
false); mfi.isValid(); ++mfi )
574 ubarNC_fab.template copy<RunOn::Device>(NC_M2NC_fab[idx]);
576 vbarNC_fab.template copy<RunOn::Device>(NC_M2NC_fab[idx]);
580 uNC_fab.template copy<RunOn::Device>(NC_M3NC_fab[idx]);
582 vNC_fab.template copy<RunOn::Device>(NC_M3NC_fab[idx]);
586 TempNC_fab.template copy<RunOn::Device>(NC_TempNC_fab[idx]);
590 SaltNC_fab.template copy<RunOn::Device>(NC_SaltNC_fab[idx]);
625 amrex::Vector<int> river_pos_x;
626 amrex::Vector<int> river_pos_y;
627 amrex::Vector<int> river_direction_tmp;
629 std::string river_x_name =
"river_Xposition";
630 std::string river_y_name =
"river_Eposition";
631 std::string river_dir_name =
"river_direction";
637 int nriv = river_pos_x.size();
638 amrex::Gpu::DeviceVector<int> xpos_d(nriv);
639 amrex::Gpu::DeviceVector<int> ypos_d(nriv);
642 Gpu::htod_memcpy(xpos_d.data(), river_pos_x.data(),
sizeof(
int)*nriv);
643 Gpu::htod_memcpy(ypos_d.data(), river_pos_y.data(),
sizeof(
int)*nriv);
644 Gpu::htod_memcpy(
river_direction.data(), river_direction_tmp.data(),
sizeof(
int)*nriv);
646 std::memcpy(xpos_d.data(), river_pos_x.data(),
sizeof(
int)*nriv);
647 std::memcpy(ypos_d.data(), river_pos_y.data(),
sizeof(
int)*nriv);
648 std::memcpy(
river_direction.data(), river_direction_tmp.data(),
sizeof(
int)*nriv);
650 const int* xpos_ptr = xpos_d.data();
651 const int* ypos_ptr = ypos_d.data();
653 for (amrex::MFIter mfi(*(
vec_river_position[lev]).get(),
true); mfi.isValid(); ++mfi) {
654 amrex::Box bx = mfi.growntilebox(amrex::IntVect(
NGROW,
NGROW,0));
656 ParallelFor(bx, [=] AMREX_GPU_DEVICE (
int i,
int j,
int ) {
657 for (
int iriv=0; iriv < nriv; iriv++) {
658 int xriv = xpos_ptr[iriv]-1;
659 int yriv = ypos_ptr[iriv]-1;
660 if (i==xriv && j==yriv) {
661 river_pos(i,j,0) = iriv;
673 Real inv_days_to_inv_s = 1.0_rt / (3600._rt * 24._rt);
675 for ( MFIter mfi(*mf, TilingIfNotGPU()); mfi.isValid(); ++mfi )
677 Array4<Real>
const& arr = mf->array(mfi);
678 Box bx = mfi.growntilebox(IntVect(
NGROW,
NGROW,0));
679 ParallelFor(bx, [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) {
680 arr(i,j,k) *= inv_days_to_inv_s;
690 Abort(
"Must specify high-resolution grid file when initializing from NetCDF and hires_grid_level > 0");
692 Vector<FArrayBox> NC_h_fab ; NC_h_fab.resize(1);
699 h_fab.template copy<RunOn::Device>(NC_h_fab[0]);
713 Abort(
"Must specify high-resolution grid file when initializing from NetCDF and hires_grid_level > 0");
715 Vector<FArrayBox> NC_pm_fab ; NC_pm_fab.resize(1);
716 Vector<FArrayBox> NC_pn_fab ; NC_pn_fab.resize(1);
719 NC_pm_fab[0], NC_pn_fab[0],
727 pm_fab.template copy<RunOn::Device>(NC_pm_fab[0]);
728 pn_fab.template copy<RunOn::Device>(NC_pn_fab[0]);
737 int rrx = ref_ratio[lev][0];
738 int rry = ref_ratio[lev][1];
740 for ( MFIter mfi(*
vec_h_full_domain[lev], TilingIfNotGPU()); mfi.isValid(); ++mfi )
744 Box ubx = mfi.growntilebox(
cum_ref_ratios[lev] - IntVect(1,0,0));;
745 Box vbx = mfi.growntilebox(
cum_ref_ratios[lev] - IntVect(0,1,0));;
746 ParallelFor(makeSlab(ubx,2,0), [=] AMREX_GPU_DEVICE (
int i,
int j,
int ) {
747 pm(i,j,0) = pm(i,j,0) / Real(rrx);
749 ParallelFor(makeSlab(vbx,2,0), [=] AMREX_GPU_DEVICE (
int i,
int j,
int ) {
750 pn(i,j,0) = pn(i,j,0) / Real(rry);
758 const auto& dom_lo = amrex::lbound(geom[lev].Domain());
759 const auto& dom_hi = amrex::ubound(geom[lev].Domain());
763 Box bx = mfi.tilebox();
768 Box gbx_lox = adjCellLo(bx,0,ng); gbx_lox.grow(1,ng); gbx_lox.setBig (0,dom_lo.x-2);
769 Box gbx_hix = adjCellHi(bx,0,ng); gbx_hix.grow(1,ng); gbx_hix.setSmall(0,dom_hi.x+2);
770 Box gbx_loy = adjCellLo(bx,1,ng); gbx_loy.grow(0,ng); gbx_loy.setBig (1,dom_lo.y-2);
771 Box gbx_hiy = adjCellHi(bx,1,ng); gbx_hiy.grow(0,ng); gbx_hiy.setSmall(1,dom_hi.y+2);
779 ParallelFor(gbx_lox, [=] AMREX_GPU_DEVICE (
int i,
int j,
int k)
781 pm_fab(i,j,k,0) = pm_fab(dom_lo.x-1,j,k,0);
782 pn_fab(i,j,k,0) = pn_fab(dom_lo.x-1,j,k,0);
786 ParallelFor(gbx_hix, [=] AMREX_GPU_DEVICE (
int i,
int j,
int k)
788 pm_fab(i,j,k,0) = pm_fab(dom_hi.x+1,j,k,0);
789 pn_fab(i,j,k,0) = pn_fab(dom_hi.x+1,j,k,0);
793 ParallelFor(gbx_loy, [=] AMREX_GPU_DEVICE (
int i,
int j,
int k)
795 pm_fab(i,j,k,0) = pm_fab(i,dom_lo.y-1,k,0);
796 pn_fab(i,j,k,0) = pn_fab(i,dom_lo.y-1,k,0);
800 ParallelFor(gbx_hiy, [=] AMREX_GPU_DEVICE (
int i,
int j,
int k)
802 pm_fab(i,j,k,0) = pm_fab(i,dom_hi.y+1,k,0);
803 pn_fab(i,j,k,0) = pn_fab(i,dom_hi.y+1,k,0);
void read_vec_from_netcdf(int lev, const amrex::Vector< std::string > &fnames, const std::string &field_name, amrex::Vector< int > &vec_dat)
helper function to read in vector of data from netcdf
void read_coriolis_from_netcdf(int lev, const Box &domain, const std::string &fname, FArrayBox &NC_fcor_fab)
helper function to read coriolis factor from netcdf
void read_grid_vars_from_netcdf(int lev, const Box &domain, const std::string &fname, FArrayBox &NC_pm_fab, FArrayBox &NC_pn_fab, FArrayBox &NC_xr_fab, FArrayBox &NC_yr_fab, FArrayBox &NC_xu_fab, FArrayBox &NC_yu_fab, FArrayBox &NC_xv_fab, FArrayBox &NC_yv_fab, FArrayBox &NC_xp_fab, FArrayBox &NC_yp_fab)
helper function to read grid variables from netcdf
void read_zeta_from_netcdf(int lev, const Box &domain, const std::string &fname, FArrayBox &NC_zeta_fab)
helper function to read sea surface height from netcdf
Real read_bdry_from_netcdf(const Box &domain, const std::string &fname, Vector< Vector< FArrayBox > > &bdy_data_xlo, Vector< Vector< FArrayBox > > &bdy_data_xhi, Vector< Vector< FArrayBox > > &bdy_data_ylo, Vector< Vector< FArrayBox > > &bdy_data_yhi, int &width, amrex::Real &start_bdy_time, std::string bdry_time_varname, amrex::GpuArray< amrex::GpuArray< bool, AMREX_SPACEDIM *2 >, BdyVars::NumTypes+1 > &)
helper function for reading boundary data from netcdf
void read_bathymetry_from_netcdf(int lev, const Box &domain, const std::string &fname, FArrayBox &NC_h_fab)
helper function to read bathymetry from netcdf
void init_state_from_netcdf(int lev, FArrayBox &temp_fab, FArrayBox &salt_fab, FArrayBox &x_vel_fab, FArrayBox &y_vel_fab, const Vector< FArrayBox > &NC_temp_fab, const Vector< FArrayBox > &NC_salt_fab, const Vector< FArrayBox > &NC_xvel_fab, const Vector< FArrayBox > &NC_yvel_fab)
helper function to initialize state from netcdf
void read_bathymetry_full_domain_from_netcdf(const Box &domain, const std::string &fname, FArrayBox &NC_h_fab, IntVect ngrow)
helper function to read full-domain high resolution bathymetry from netcdf
void read_masks_from_netcdf(int, const Box &domain, const std::string &fname, FArrayBox &NC_mskr_fab, FArrayBox &NC_msku_fab, FArrayBox &NC_mskv_fab)
helper function for reading in land-sea masks from netcdf
void read_data_from_netcdf(int, const Box &domain, const std::string &fname, FArrayBox &NC_temp_fab, FArrayBox &NC_salt_fab, FArrayBox &NC_xvel_fab, FArrayBox &NC_yvel_fab)
helper function for reading in initial state data from netcdf
void read_grid_vars_full_domain_from_netcdf(const Box &domain, const std::string &fname, FArrayBox &NC_pm_fab, FArrayBox &NC_pn_fab, IntVect ngrow)
helper function to read full-domain high resolution grid variables from netcdf
void read_clim_nudg_coeff_from_netcdf(int lev, const Box &domain, const std::string &fname, bool do_m2_clim_nudg, bool do_m3_clim_nudg, bool do_temp_clim_nudg, bool do_salt_clim_nudg, FArrayBox &NC_M2NC_fab, FArrayBox &NC_M3NC_fab, FArrayBox &NC_TempNC_fab, FArrayBox &NC_SaltNC_fab)
helper function to read climatology nudging from netcdf
A class to hold and interpolate time series data read from a NetCDF file.
std::string nc_grid_file_hires
Grid file for high resolution bathymetry.
amrex::Vector< std::string > nc_riv_file
NetCDF river file(s)
int foextrap_periodic_bc() const noexcept
void init_bathymetry_from_netcdf(int lev)
Bathymetry data initialization from NetCDF file.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_fcor
coriolis factor (2D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_h
Bathymetry data (2D, positive valued, h in ROMS)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_pm
horizontal scaling factor: 1 / dx (2D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_yv
y_grid on v-points (2D)
amrex::Vector< amrex::MultiFab * > cons_new
multilevel data container for current step's scalar data: temperature, salinity, passive tracer
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_mskr
land/sea mask at cell centers (2D)
void init_grid_vars_from_netcdf(int lev)
Grid variable initialization from NetCDF file.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_yp
y_grid on psi-points (2D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_xr
x_grid on rho points (2D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_xv
x_grid on v-points (2D)
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_msku
land/sea mask at x-faces (2D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_pm_full_domain
horizontal scaling factor: 1 / dx (2D) on whole domain
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)
int zeta_bc() const noexcept
amrex::Vector< amrex::IntVect > cum_ref_ratios
Cumulative refinement ratio between level 0 and level i.
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)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_mskp
land/sea mask at cell corners (2D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_mskv
land/sea mask at y-faces (2D)
amrex::Vector< std::unique_ptr< REMORAPhysBCFunct > > physbcs
Vector (over level) of functors to apply physical boundary conditions.
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=true, const int n_not_fill=0, const int icomp_calc=0, const amrex::Real dt=amrex::Real(0.0), const amrex::MultiFab &mf_calc=amrex::MultiFab())
Fill a new MultiFab by copying in phi from valid region and filling ghost cells.
std::string nc_clim_coeff_file
NetCDF climatology coefficient file.
amrex::Vector< std::string > bdry_time_name_byvar
Name of time fields for boundary data.
void init_riv_pos_from_netcdf(int lev)
static amrex::Vector< std::string > nc_bdry_file
NetCDF boundary data.
void update_mskp(int lev)
Set psi-point mask to be consistent with rho-point mask.
void init_zeta_from_netcdf(int lev)
Sea-surface height data initialization from NetCDF file.
void init_coriolis_from_netcdf(int lev)
Coriolis parameter data initialization from NetCDF file.
void fill_from_bdyfiles(int lev, amrex::MultiFab &mf_to_fill, const amrex::MultiFab &mf_mask, const amrex::Real time, const int bccomp, const int bdy_var_type, const int icomp_to_fill, const int icomp_calc=0, const amrex::MultiFab &mf_calc=amrex::MultiFab(), const amrex::Real=amrex::Real(0.0))
Fill boundary data from netcdf file.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_h_full_domain
Bathymetry data on the whole domain at each potential level.
int nscalar
Number of passive scalars carried in the state.
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::Vector< amrex::Real > t_new
new time at each level
void init_bdry_from_netcdf(int lev)
Boundary data initialization from NetCDF file.
static SolverChoice solverChoice
Container for algorithmic choices.
amrex::Vector< std::unique_ptr< amrex::iMultiFab > > vec_river_position
iMultiFab for river positions; contents are indices of rivers
amrex::Vector< amrex::Vector< std::unique_ptr< NCTimeSeriesBoundary > > > boundary_series
Vector over BdyVars of boundary series data containers.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_xp
x_grid on psi-points (2D)
static amrex::Vector< amrex::Vector< std::string > > nc_grid_file
NetCDF grid file.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_zeta
free surface height (2D)
amrex::Gpu::DeviceVector< int > river_direction
Vector over rivers of river direction: 0: u-face; 1: v-face; 2: w-face.
amrex::Box nc_hires_grid_box
Box for the full domain at nc_hires_grid_level.
void init_clim_nudg_coeff_from_netcdf(int lev)
Climatology nudging coefficient initialization from NetCDF file.
void init_bathymetry_full_domain_from_netcdf()
Full domain high-res bathymetry data initialization from NetCDF file.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_yu
y_grid on u-points (2D)
void init_grid_vars_full_domain_from_netcdf()
Full domain high-res grid variable initialization from NetCDF file.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_xu
x_grid on u-points (2D)
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_pn_full_domain
horizontal scaling factor: 1 / dy (2D) on whole domain
amrex::GpuArray< amrex::GpuArray< bool, AMREX_SPACEDIM *2 >, BdyVars::NumTypes+1 > phys_bc_need_data
These are flags that indicate whether we need to read in boundary data from file.
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)
static amrex::Vector< amrex::Vector< std::string > > nc_init_file
NetCDF initialization file.
amrex::Vector< amrex::Real > t_old
old time at each level
int hires_grid_level
Which level the high resolution bathymetry is at.
void convert_inv_days_to_inv_s(amrex::MultiFab *)
Convert data in a multifab from inverse days to inverse seconds.
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_yr
y_grid on rho points (2D)
bool boundary_from_netcdf