22 U_old.FillBoundary(geom[lev].periodicity());
23 V_old.FillBoundary(geom[lev].periodicity());
24 W_old.FillBoundary(geom[lev].periodicity());
- 25 MultiFab::Copy(S_new,S_old,0,0,S_new.nComp(),S_new.nGrowVect());
- 26 MultiFab::Copy(U_new,U_old,0,0,U_new.nComp(),U_new.nGrowVect());
- 27 MultiFab::Copy(V_new,V_old,0,0,V_new.nComp(),V_new.nGrowVect());
- 28 MultiFab::Copy(W_new,W_old,0,0,W_new.nComp(),W_new.nGrowVect());
-
-
-
- 32 const BoxArray& ba = S_old.boxArray();
- 33 const DistributionMapping& dm = S_old.DistributionMap();
-
- 35 int nvars = S_old.nComp();
-
-
- 38 const int nrhs = ncomp-1;
- 39 const int nnew = ncomp-1;
- 40 const int nstp = ncomp-1;
+
+
+
+ 28 const BoxArray& ba = S_old.boxArray();
+ 29 const DistributionMapping& dm = S_old.DistributionMap();
+
+ 31 int nvars = S_old.nComp();
+
+
+ 34 const int nrhs = ncomp-1;
+ 35 const int nnew = ncomp-1;
+ 36 const int nstp = ncomp-1;
+
+
+ 39 MultiFab source(ba,dm,nvars,1);
+
-
- 43 MultiFab source(ba,dm,nvars,1);
-
+
+
+
-
-
-
-
-
- 51 MultiFab mf_AK(ba,dm,1,IntVect(
NGROW,
NGROW,0));
-
-
- 54 std::unique_ptr<MultiFab>& mf_Hz =
vec_Hz[lev];
- 55 std::unique_ptr<MultiFab>& mf_z_r =
vec_z_r[lev];
- 56 std::unique_ptr<MultiFab>& mf_z_w =
vec_z_w[lev];
-
-
-
-
-
-
-
- 64 MultiFab mf_u(U_new, amrex::make_alias, 0, 1);
- 65 MultiFab mf_v(V_new, amrex::make_alias, 0, 1);
- 66 MultiFab mf_uold(U_old, amrex::make_alias, 0, 1);
- 67 MultiFab mf_vold(V_old, amrex::make_alias, 0, 1);
-
- 69 MultiFab mf_pden(ba,dm,1,IntVect(
NGROW,
NGROW,0));
- 70 MultiFab mf_rho(ba,dm,1,IntVect(
NGROW,
NGROW,0));
- 71 MultiFab mf_rhoS(ba,dm,1,IntVect(
NGROW,
NGROW,0));
- 72 MultiFab mf_rhoA(ba,dm,1,IntVect(
NGROW,
NGROW,0));
- 73 std::unique_ptr<MultiFab>& mf_ru =
vec_ru[lev];
- 74 std::unique_ptr<MultiFab>& mf_rv =
vec_rv[lev];
- 75 std::unique_ptr<MultiFab>& mf_rufrc =
vec_rufrc[lev];
- 76 std::unique_ptr<MultiFab>& mf_rvfrc =
vec_rvfrc[lev];
- 77 std::unique_ptr<MultiFab>& mf_sustr =
vec_sustr[lev];
- 78 std::unique_ptr<MultiFab>& mf_svstr =
vec_svstr[lev];
- 79 std::unique_ptr<MultiFab>& mf_rdrag =
vec_rdrag[lev];
- 80 std::unique_ptr<MultiFab>& mf_bustr =
vec_bustr[lev];
- 81 std::unique_ptr<MultiFab>& mf_bvstr =
vec_bvstr[lev];
- 82 std::unique_ptr<MultiFab>& mf_ubar =
vec_ubar[lev];
- 83 std::unique_ptr<MultiFab>& mf_vbar =
vec_vbar[lev];
- 84 MultiFab mf_temp(S_new, amrex::make_alias,
Temp_comp, 1);
- 85 #ifdef ROMSX_USE_SALINITY
- 86 MultiFab mf_salt(S_new, amrex::make_alias, Salt_comp, 1);
-
- 88 MultiFab mf_salt(S_new, amrex::make_alias,
Temp_comp, 1);
-
- 90 MultiFab mf_tempold(S_old, amrex::make_alias,
Temp_comp, 1);
- 91 #ifdef ROMSX_USE_SALINITY
- 92 MultiFab mf_saltold(S_old, amrex::make_alias, Salt_comp, 1);
-
- 94 MultiFab mf_saltold(S_old, amrex::make_alias,
Temp_comp, 1);
-
- 96 MultiFab mf_rw(ba,dm,1,IntVect(
NGROW,
NGROW,0));
- 97 MultiFab mf_W(ba,dm,1,IntVect(
NGROW+1,
NGROW+1,0));
-
- 99 std::unique_ptr<MultiFab>& mf_visc2_p =
vec_visc2_p[lev];
- 100 std::unique_ptr<MultiFab>& mf_visc2_r =
vec_visc2_r[lev];
-
-
-
-
-
-
-
-
-
-
- 111 mf_pden.setVal(0.e34,IntVect(AMREX_D_DECL(
NGROW-1,
NGROW-1,0)));
- 112 mf_rho.setVal(0.e34,IntVect(AMREX_D_DECL(
NGROW-1,
NGROW-1,0)));
- 113 mf_rhoS.setVal(0.e34,IntVect(AMREX_D_DECL(
NGROW-1,
NGROW-1,0)));
- 114 mf_rhoA.setVal(0.e34,IntVect(AMREX_D_DECL(
NGROW-1,
NGROW-1,0)));
-
-
- 117 mf_w.setVal(0.e34,IntVect(AMREX_D_DECL(
NGROW-1,
NGROW-1,0)));
-
- 119 MultiFab::Copy(mf_u,U_new,0,0,U_new.nComp(),IntVect(AMREX_D_DECL(
NGROW,
NGROW,0)));
- 120 MultiFab::Copy(mf_v,V_new,0,0,V_new.nComp(),IntVect(AMREX_D_DECL(
NGROW,
NGROW,0)));
- 121 MultiFab::Copy(mf_uold,U_old,0,0,U_old.nComp(),IntVect(AMREX_D_DECL(
NGROW,
NGROW,0)));
- 122 MultiFab::Copy(mf_vold,V_old,0,0,V_old.nComp(),IntVect(AMREX_D_DECL(
NGROW,
NGROW,0)));
- 123 MultiFab::Copy(mf_w,W_new,0,0,W_new.nComp(),IntVect(AMREX_D_DECL(
NGROW,
NGROW,0)));
-
-
- 126 mf_u.FillBoundary(geom[lev].periodicity());
- 127 mf_v.FillBoundary(geom[lev].periodicity());
- 128 mf_uold.FillBoundary(geom[lev].periodicity());
- 129 mf_vold.FillBoundary(geom[lev].periodicity());
- 130 mf_w.FillBoundary(geom[lev].periodicity());
- 131 mf_W.FillBoundary(geom[lev].periodicity());
- 132 mf_tempold.FillBoundary(geom[lev].periodicity());
- 133 mf_temp.FillBoundary(geom[lev].periodicity());
- 134 mf_saltold.FillBoundary(geom[lev].periodicity());
- 135 mf_salt.FillBoundary(geom[lev].periodicity());
-
-
-
- 139 U_old.FillBoundary(geom[lev].periodicity());
- 140 V_old.FillBoundary(geom[lev].periodicity());
-
-
-
- 144 int iic =
istep[lev];
-
- 146 if(iic==ntfirst&&
false)
- 147 MultiFab::Copy(S_new,S_old,0,0,S_new.nComp(),IntVect(AMREX_D_DECL(
NGROW,
NGROW,
NGROW)));
-
-
- 150 auto N = Geom(lev).Domain().size()[2]-1;
-
- 152 const auto prob_lo = Geom(lev).ProbLoArray();
- 153 const auto dxi = Geom(lev).InvCellSizeArray();
- 154 const auto dx = Geom(lev).CellSizeArray();
- 155 const int Mm = Geom(lev).Domain().size()[1];
- 156 auto geomdata = Geom(lev).data();
-
-
- 159 for ( MFIter mfi(mf_temp, TilingIfNotGPU()); mfi.isValid(); ++mfi )
-
- 161 Array4<Real>
const& DC = mf_DC.array(mfi);
- 162 Array4<Real>
const& Akv = (
vec_Akv[lev])->array(mfi);
-
- 164 Array4<Real>
const& Hz = (
vec_Hz[lev])->array(mfi);
- 165 Array4<Real>
const& Huon = (
vec_Huon[lev])->array(mfi);
- 166 Array4<Real>
const& Hvom = (
vec_Hvom[lev])->array(mfi);
- 167 Array4<Real>
const& z_r = (mf_z_r)->array(mfi);
- 168 Array4<Real>
const& z_w = (mf_z_w)->array(mfi);
- 169 Array4<Real>
const& uold = (mf_uold).array(mfi);
- 170 Array4<Real>
const& vold = (mf_vold).array(mfi);
- 171 Array4<Real>
const&
u = (mf_u).array(mfi);
- 172 Array4<Real>
const&
v = (mf_v).array(mfi);
- 173 Array4<Real>
const& pden = (mf_pden).array(mfi);
- 174 Array4<Real>
const& rho = (mf_rho).array(mfi);
- 175 Array4<Real>
const& rhoA = (mf_rhoA).array(mfi);
- 176 Array4<Real>
const& rhoS = (mf_rhoS).array(mfi);
- 177 Array4<Real>
const& tempold = (mf_tempold).array(mfi);
- 178 Array4<Real>
const& saltold = (mf_saltold).array(mfi);
- 179 Array4<Real>
const& temp = (mf_temp).array(mfi);
- 180 Array4<Real>
const& salt = (mf_salt).array(mfi);
- 181 Array4<Real>
const& tempstore = (
vec_t3[lev])->array(mfi);
- 182 Array4<Real>
const& saltstore = (
vec_s3[lev])->array(mfi);
- 183 Array4<Real>
const& ru = (mf_ru)->array(mfi);
- 184 Array4<Real>
const& rv = (mf_rv)->array(mfi);
- 185 Array4<Real>
const& rufrc = (mf_rufrc)->array(mfi);
- 186 Array4<Real>
const& rvfrc = (mf_rvfrc)->array(mfi);
- 187 Array4<Real>
const& W = (mf_W).array(mfi);
- 188 Array4<Real>
const& sustr = (mf_sustr)->array(mfi);
- 189 Array4<Real>
const& svstr = (mf_svstr)->array(mfi);
- 190 Array4<Real>
const& rdrag = (mf_rdrag)->array(mfi);
- 191 Array4<Real>
const& bustr = (mf_bustr)->array(mfi);
- 192 Array4<Real>
const& bvstr = (mf_bvstr)->array(mfi);
- 193 Array4<Real>
const& ubar = (mf_ubar)->array(mfi);
- 194 Array4<Real>
const& vbar = (mf_vbar)->array(mfi);
- 195 Array4<Real>
const& visc2_p = (mf_visc2_p)->array(mfi);
- 196 Array4<Real>
const& visc2_r = (mf_visc2_r)->array(mfi);
- 197 Array4<Real>
const& diff2_salt = (mf_diff2_salt)->array(mfi);
- 198 Array4<Real>
const& diff2_temp = (mf_diff2_temp)->array(mfi);
-
- 200 Box bx = mfi.tilebox();
- 201 Box gbx = mfi.growntilebox();
- 202 Box gbx1 = mfi.growntilebox(IntVect(
NGROW-1,
NGROW-1,0));
- 203 Box gbx2 = mfi.growntilebox(IntVect(
NGROW,
NGROW,0));
-
-
-
-
-
-
-
-
-
-
- 214 Box ubx = surroundingNodes(bx,0);
- 215 Box vbx = surroundingNodes(bx,1);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 230 FArrayBox fab_FC(gbx2,1,amrex::The_Async_Arena());
- 231 FArrayBox fab_FX(gbx2,1,amrex::The_Async_Arena());
- 232 FArrayBox fab_FE(gbx2,1,amrex::The_Async_Arena());
- 233 FArrayBox fab_BC(gbx2,1,amrex::The_Async_Arena());
- 234 FArrayBox fab_CF(gbx2,1,amrex::The_Async_Arena());
- 235 FArrayBox fab_pn(gbx2D,1,amrex::The_Async_Arena());
- 236 FArrayBox fab_pm(gbx2D,1,amrex::The_Async_Arena());
- 237 FArrayBox fab_on_u(gbx2D,1,amrex::The_Async_Arena());
- 238 FArrayBox fab_om_v(gbx2D,1,amrex::The_Async_Arena());
- 239 FArrayBox fab_om_u(gbx2D,1,amrex::The_Async_Arena());
- 240 FArrayBox fab_on_v(gbx2D,1,amrex::The_Async_Arena());
- 241 FArrayBox fab_om_r(gbx2D,1,amrex::The_Async_Arena());
- 242 FArrayBox fab_on_r(gbx2D,1,amrex::The_Async_Arena());
- 243 FArrayBox fab_om_p(gbx2D,1,amrex::The_Async_Arena());
- 244 FArrayBox fab_on_p(gbx2D,1,amrex::The_Async_Arena());
- 245 FArrayBox fab_pmon_u(gbx2D,1,amrex::The_Async_Arena());
- 246 FArrayBox fab_pnom_u(gbx2D,1,amrex::The_Async_Arena());
- 247 FArrayBox fab_pmon_v(gbx2D,1,amrex::The_Async_Arena());
- 248 FArrayBox fab_pnom_v(gbx2D,1,amrex::The_Async_Arena());
- 249 FArrayBox fab_fomn(gbx2D,1,amrex::The_Async_Arena());
-
-
- 252 auto FC=fab_FC.array();
- 253 auto FX=fab_FX.array();
- 254 auto FE=fab_FE.array();
- 255 auto pn=fab_pn.array();
- 256 auto pm=fab_pm.array();
- 257 auto on_u=fab_on_u.array();
- 258 auto om_v=fab_om_v.array();
- 259 auto om_u=fab_om_u.array();
- 260 auto on_v=fab_on_v.array();
- 261 auto om_r=fab_om_r.array();
- 262 auto on_r=fab_on_r.array();
- 263 auto om_p=fab_om_p.array();
- 264 auto on_p=fab_on_p.array();
- 265 auto pmon_u=fab_pmon_u.array();
- 266 auto pnom_u=fab_pnom_u.array();
- 267 auto pmon_v=fab_pmon_v.array();
- 268 auto pnom_v=fab_pnom_v.array();
- 269 auto fomn=fab_fomn.array();
-
-
- 272 amrex::ParallelFor(gbx2D,
- 273 [=] AMREX_GPU_DEVICE (
int i,
int j,
int )
-
-
-
-
-
-
- 280 Real Esize=1000*(Mm);
- 281 Real y = prob_lo[1] + (j + 0.5) * dx[1];
- 282 Real f=f0+beta*(
y-.5*Esize);
- 283 fomn(i,j,0)=f*(1.0/(pm(i,j,0)*pn(i,j,0)));
-
-
- 286 amrex::ParallelFor(gbx2D,
- 287 [=] AMREX_GPU_DEVICE (
int i,
int j,
int )
-
-
- 290 om_v(i,j,0)=1.0/dxi[0];
- 291 on_u(i,j,0)=1.0/dxi[1];
- 292 om_r(i,j,0)=1.0/dxi[0];
- 293 on_r(i,j,0)=1.0/dxi[1];
-
- 295 om_p(i,j,0)=1.0/dxi[0];
- 296 on_p(i,j,0)=1.0/dxi[1];
- 297 on_v(i,j,0)=1.0/dxi[1];
- 298 om_u(i,j,0)=1.0/dxi[0];
-
-
-
-
-
-
- 305 amrex::ParallelFor(gbx2,
- 306 [=] AMREX_GPU_DEVICE (
int i,
int j,
int k)
-
-
-
-
-
-
- 313 amrex::ParallelFor(gbx1D,
- 314 [=] AMREX_GPU_DEVICE (
int i,
int j,
int )
-
-
-
- 318 bustr(i,j,0) = 0.5 * (rdrag(i-1,j,0)+rdrag(i,j,0))*(uold(i,j,0,nrhs));
-
-
- 321 bvstr(i,j,0) = 0.5 * (rdrag(i,j-1,0)+rdrag(i,j,0))*(vold(i,j,0,nrhs));
-
-
-
-
-
-
- 328 rho_eos(gbx2,temp,salt,rho,rhoA,rhoS,pden,Hz,z_w,h,nrhs,N);
-
-
-
- 332 prestep(lev, mf_uold, mf_vold, mf_u, mf_v, mf_ru, mf_rv, mf_tempold, mf_saltold,
-
- 334 mf_DC,
vec_t3[lev],
vec_s3[lev], mf_z_r, mf_z_w, mf_h, mf_sustr, mf_svstr, mf_bustr,
- 335 mf_bvstr, iic, ntfirst, nnew, nstp, nrhs, N, dt_lev);
-
+
+ 47 MultiFab mf_AK(ba,dm,1,IntVect(
NGROW,
NGROW,0));
+
+
+ 50 std::unique_ptr<MultiFab>& mf_Hz =
vec_Hz[lev];
+ 51 std::unique_ptr<MultiFab>& mf_z_r =
vec_z_r[lev];
+ 52 std::unique_ptr<MultiFab>& mf_z_w =
vec_z_w[lev];
+
+
+
+
+
+
+
+ 60 MultiFab mf_u(U_new, amrex::make_alias, 0, 1);
+ 61 MultiFab mf_v(V_new, amrex::make_alias, 0, 1);
+ 62 MultiFab mf_uold(U_old, amrex::make_alias, 0, 1);
+ 63 MultiFab mf_vold(V_old, amrex::make_alias, 0, 1);
+
+ 65 MultiFab mf_pden(ba,dm,1,IntVect(
NGROW,
NGROW,0));
+ 66 MultiFab mf_rho(ba,dm,1,IntVect(
NGROW,
NGROW,0));
+ 67 MultiFab mf_rhoS(ba,dm,1,IntVect(
NGROW,
NGROW,0));
+ 68 MultiFab mf_rhoA(ba,dm,1,IntVect(
NGROW,
NGROW,0));
+ 69 std::unique_ptr<MultiFab>& mf_ru =
vec_ru[lev];
+ 70 std::unique_ptr<MultiFab>& mf_rv =
vec_rv[lev];
+ 71 std::unique_ptr<MultiFab>& mf_rufrc =
vec_rufrc[lev];
+ 72 std::unique_ptr<MultiFab>& mf_rvfrc =
vec_rvfrc[lev];
+ 73 std::unique_ptr<MultiFab>& mf_sustr =
vec_sustr[lev];
+ 74 std::unique_ptr<MultiFab>& mf_svstr =
vec_svstr[lev];
+ 75 std::unique_ptr<MultiFab>& mf_rdrag =
vec_rdrag[lev];
+ 76 std::unique_ptr<MultiFab>& mf_bustr =
vec_bustr[lev];
+ 77 std::unique_ptr<MultiFab>& mf_bvstr =
vec_bvstr[lev];
+ 78 std::unique_ptr<MultiFab>& mf_ubar =
vec_ubar[lev];
+ 79 std::unique_ptr<MultiFab>& mf_vbar =
vec_vbar[lev];
+ 80 MultiFab mf_temp(S_new, amrex::make_alias,
Temp_comp, 1);
+ 81 #ifdef ROMSX_USE_SALINITY
+ 82 MultiFab mf_salt(S_new, amrex::make_alias, Salt_comp, 1);
+
+ 84 MultiFab mf_salt(S_new, amrex::make_alias,
Temp_comp, 1);
+
+ 86 MultiFab mf_tempold(S_old, amrex::make_alias,
Temp_comp, 1);
+ 87 #ifdef ROMSX_USE_SALINITY
+ 88 MultiFab mf_saltold(S_old, amrex::make_alias, Salt_comp, 1);
+
+ 90 MultiFab mf_saltold(S_old, amrex::make_alias,
Temp_comp, 1);
+
+ 92 MultiFab mf_rw(ba,dm,1,IntVect(
NGROW,
NGROW,0));
+ 93 MultiFab mf_W(ba,dm,1,IntVect(
NGROW+1,
NGROW+1,0));
+
+ 95 std::unique_ptr<MultiFab>& mf_visc2_p =
vec_visc2_p[lev];
+ 96 std::unique_ptr<MultiFab>& mf_visc2_r =
vec_visc2_r[lev];
+
+
+
+
+
+
+
+
+
+
+ 107 mf_pden.setVal(0.e34,IntVect(AMREX_D_DECL(
NGROW-1,
NGROW-1,0)));
+ 108 mf_rho.setVal(0.e34,IntVect(AMREX_D_DECL(
NGROW-1,
NGROW-1,0)));
+ 109 mf_rhoS.setVal(0.e34,IntVect(AMREX_D_DECL(
NGROW-1,
NGROW-1,0)));
+ 110 mf_rhoA.setVal(0.e34,IntVect(AMREX_D_DECL(
NGROW-1,
NGROW-1,0)));
+
+
+ 113 mf_w.setVal(0.e34,IntVect(AMREX_D_DECL(
NGROW-1,
NGROW-1,0)));
+
+ 115 MultiFab::Copy(mf_u,U_new,0,0,U_new.nComp(),IntVect(AMREX_D_DECL(
NGROW,
NGROW,0)));
+ 116 MultiFab::Copy(mf_v,V_new,0,0,V_new.nComp(),IntVect(AMREX_D_DECL(
NGROW,
NGROW,0)));
+ 117 MultiFab::Copy(mf_uold,U_old,0,0,U_old.nComp(),IntVect(AMREX_D_DECL(
NGROW,
NGROW,0)));
+ 118 MultiFab::Copy(mf_vold,V_old,0,0,V_old.nComp(),IntVect(AMREX_D_DECL(
NGROW,
NGROW,0)));
+ 119 MultiFab::Copy(mf_w,W_new,0,0,W_new.nComp(),IntVect(AMREX_D_DECL(
NGROW,
NGROW,0)));
+
+
+ 122 mf_u.FillBoundary(geom[lev].periodicity());
+ 123 mf_v.FillBoundary(geom[lev].periodicity());
+ 124 mf_uold.FillBoundary(geom[lev].periodicity());
+ 125 mf_vold.FillBoundary(geom[lev].periodicity());
+ 126 mf_w.FillBoundary(geom[lev].periodicity());
+ 127 mf_W.FillBoundary(geom[lev].periodicity());
+ 128 mf_tempold.FillBoundary(geom[lev].periodicity());
+ 129 mf_temp.FillBoundary(geom[lev].periodicity());
+ 130 mf_saltold.FillBoundary(geom[lev].periodicity());
+ 131 mf_salt.FillBoundary(geom[lev].periodicity());
+
+
+
+ 135 U_old.FillBoundary(geom[lev].periodicity());
+ 136 V_old.FillBoundary(geom[lev].periodicity());
+
+
+
+ 140 int iic =
istep[lev];
+
+
+ 143 MultiFab::Copy(S_new,S_old,0,0,S_new.nComp(),S_new.nGrowVect());
+ 144 MultiFab::Copy(U_new,U_old,0,0,U_new.nComp(),U_new.nGrowVect());
+ 145 MultiFab::Copy(V_new,V_old,0,0,V_new.nComp(),V_new.nGrowVect());
+ 146 MultiFab::Copy(W_new,W_old,0,0,W_new.nComp(),W_new.nGrowVect());
+
+
+ 149 auto N = Geom(lev).Domain().size()[2]-1;
+
+ 151 const auto prob_lo = Geom(lev).ProbLoArray();
+ 152 const auto dxi = Geom(lev).InvCellSizeArray();
+ 153 const auto dx = Geom(lev).CellSizeArray();
+ 154 const int Mm = Geom(lev).Domain().size()[1];
+ 155 auto geomdata = Geom(lev).data();
+
+
+ 158 for ( MFIter mfi(mf_temp, TilingIfNotGPU()); mfi.isValid(); ++mfi )
+
+ 160 Array4<Real>
const& DC = mf_DC.array(mfi);
+ 161 Array4<Real>
const& Akv = (
vec_Akv[lev])->array(mfi);
+
+ 163 Array4<Real>
const& Hz = (
vec_Hz[lev])->array(mfi);
+ 164 Array4<Real>
const& Huon = (
vec_Huon[lev])->array(mfi);
+ 165 Array4<Real>
const& Hvom = (
vec_Hvom[lev])->array(mfi);
+ 166 Array4<Real>
const& z_r = (mf_z_r)->array(mfi);
+ 167 Array4<Real>
const& z_w = (mf_z_w)->array(mfi);
+ 168 Array4<Real>
const& uold = (mf_uold).array(mfi);
+ 169 Array4<Real>
const& vold = (mf_vold).array(mfi);
+ 170 Array4<Real>
const&
u = (mf_u).array(mfi);
+ 171 Array4<Real>
const&
v = (mf_v).array(mfi);
+ 172 Array4<Real>
const& pden = (mf_pden).array(mfi);
+ 173 Array4<Real>
const& rho = (mf_rho).array(mfi);
+ 174 Array4<Real>
const& rhoA = (mf_rhoA).array(mfi);
+ 175 Array4<Real>
const& rhoS = (mf_rhoS).array(mfi);
+ 176 Array4<Real>
const& tempold = (mf_tempold).array(mfi);
+ 177 Array4<Real>
const& saltold = (mf_saltold).array(mfi);
+ 178 Array4<Real>
const& temp = (mf_temp).array(mfi);
+ 179 Array4<Real>
const& salt = (mf_salt).array(mfi);
+ 180 Array4<Real>
const& tempstore = (
vec_t3[lev])->array(mfi);
+ 181 Array4<Real>
const& saltstore = (
vec_s3[lev])->array(mfi);
+ 182 Array4<Real>
const& ru = (mf_ru)->array(mfi);
+ 183 Array4<Real>
const& rv = (mf_rv)->array(mfi);
+ 184 Array4<Real>
const& rufrc = (mf_rufrc)->array(mfi);
+ 185 Array4<Real>
const& rvfrc = (mf_rvfrc)->array(mfi);
+ 186 Array4<Real>
const& W = (mf_W).array(mfi);
+ 187 Array4<Real>
const& sustr = (mf_sustr)->array(mfi);
+ 188 Array4<Real>
const& svstr = (mf_svstr)->array(mfi);
+ 189 Array4<Real>
const& rdrag = (mf_rdrag)->array(mfi);
+ 190 Array4<Real>
const& bustr = (mf_bustr)->array(mfi);
+ 191 Array4<Real>
const& bvstr = (mf_bvstr)->array(mfi);
+ 192 Array4<Real>
const& ubar = (mf_ubar)->array(mfi);
+ 193 Array4<Real>
const& vbar = (mf_vbar)->array(mfi);
+ 194 Array4<Real>
const& visc2_p = (mf_visc2_p)->array(mfi);
+ 195 Array4<Real>
const& visc2_r = (mf_visc2_r)->array(mfi);
+ 196 Array4<Real>
const& diff2_salt = (mf_diff2_salt)->array(mfi);
+ 197 Array4<Real>
const& diff2_temp = (mf_diff2_temp)->array(mfi);
+
+ 199 Box bx = mfi.tilebox();
+ 200 Box gbx = mfi.growntilebox();
+ 201 Box gbx1 = mfi.growntilebox(IntVect(
NGROW-1,
NGROW-1,0));
+ 202 Box gbx2 = mfi.growntilebox(IntVect(
NGROW,
NGROW,0));
+
+
+
+
+
+
+
+
+
+
+ 213 Box ubx = surroundingNodes(bx,0);
+ 214 Box vbx = surroundingNodes(bx,1);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 229 FArrayBox fab_FC(gbx2,1,amrex::The_Async_Arena());
+ 230 FArrayBox fab_FX(gbx2,1,amrex::The_Async_Arena());
+ 231 FArrayBox fab_FE(gbx2,1,amrex::The_Async_Arena());
+ 232 FArrayBox fab_BC(gbx2,1,amrex::The_Async_Arena());
+ 233 FArrayBox fab_CF(gbx2,1,amrex::The_Async_Arena());
+ 234 FArrayBox fab_pn(gbx2D,1,amrex::The_Async_Arena());
+ 235 FArrayBox fab_pm(gbx2D,1,amrex::The_Async_Arena());
+ 236 FArrayBox fab_on_u(gbx2D,1,amrex::The_Async_Arena());
+ 237 FArrayBox fab_om_v(gbx2D,1,amrex::The_Async_Arena());
+ 238 FArrayBox fab_om_u(gbx2D,1,amrex::The_Async_Arena());
+ 239 FArrayBox fab_on_v(gbx2D,1,amrex::The_Async_Arena());
+ 240 FArrayBox fab_om_r(gbx2D,1,amrex::The_Async_Arena());
+ 241 FArrayBox fab_on_r(gbx2D,1,amrex::The_Async_Arena());
+ 242 FArrayBox fab_om_p(gbx2D,1,amrex::The_Async_Arena());
+ 243 FArrayBox fab_on_p(gbx2D,1,amrex::The_Async_Arena());
+ 244 FArrayBox fab_pmon_u(gbx2D,1,amrex::The_Async_Arena());
+ 245 FArrayBox fab_pnom_u(gbx2D,1,amrex::The_Async_Arena());
+ 246 FArrayBox fab_pmon_v(gbx2D,1,amrex::The_Async_Arena());
+ 247 FArrayBox fab_pnom_v(gbx2D,1,amrex::The_Async_Arena());
+ 248 FArrayBox fab_fomn(gbx2D,1,amrex::The_Async_Arena());
+
+
+ 251 auto FC=fab_FC.array();
+ 252 auto FX=fab_FX.array();
+ 253 auto FE=fab_FE.array();
+ 254 auto pn=fab_pn.array();
+ 255 auto pm=fab_pm.array();
+ 256 auto on_u=fab_on_u.array();
+ 257 auto om_v=fab_om_v.array();
+ 258 auto om_u=fab_om_u.array();
+ 259 auto on_v=fab_on_v.array();
+ 260 auto om_r=fab_om_r.array();
+ 261 auto on_r=fab_on_r.array();
+ 262 auto om_p=fab_om_p.array();
+ 263 auto on_p=fab_on_p.array();
+ 264 auto pmon_u=fab_pmon_u.array();
+ 265 auto pnom_u=fab_pnom_u.array();
+ 266 auto pmon_v=fab_pmon_v.array();
+ 267 auto pnom_v=fab_pnom_v.array();
+ 268 auto fomn=fab_fomn.array();
+
+
+ 271 amrex::ParallelFor(gbx2D,
+ 272 [=] AMREX_GPU_DEVICE (
int i,
int j,
int )
+
+
+
+
+
+
+ 279 Real Esize=1000*(Mm);
+ 280 Real y = prob_lo[1] + (j + 0.5) * dx[1];
+ 281 Real f=f0+beta*(
y-.5*Esize);
+ 282 fomn(i,j,0)=f*(1.0/(pm(i,j,0)*pn(i,j,0)));
+
+
+ 285 amrex::ParallelFor(gbx2D,
+ 286 [=] AMREX_GPU_DEVICE (
int i,
int j,
int )
+
+
+ 289 om_v(i,j,0)=1.0/dxi[0];
+ 290 on_u(i,j,0)=1.0/dxi[1];
+ 291 om_r(i,j,0)=1.0/dxi[0];
+ 292 on_r(i,j,0)=1.0/dxi[1];
+
+ 294 om_p(i,j,0)=1.0/dxi[0];
+ 295 on_p(i,j,0)=1.0/dxi[1];
+ 296 on_v(i,j,0)=1.0/dxi[1];
+ 297 om_u(i,j,0)=1.0/dxi[0];
+
+
+
+
+
+
+ 304 amrex::ParallelFor(gbx2,
+ 305 [=] AMREX_GPU_DEVICE (
int i,
int j,
int k)
+
+
+
+
+
+
+ 312 amrex::ParallelFor(gbx1D,
+ 313 [=] AMREX_GPU_DEVICE (
int i,
int j,
int )
+
+
+
+ 317 bustr(i,j,0) = 0.5 * (rdrag(i-1,j,0)+rdrag(i,j,0))*(uold(i,j,0,nrhs));
+
+
+ 320 bvstr(i,j,0) = 0.5 * (rdrag(i,j-1,0)+rdrag(i,j,0))*(vold(i,j,0,nrhs));
+
+
+
+
+
+
+ 327 rho_eos(gbx2,temp,salt,rho,rhoA,rhoS,pden,Hz,z_w,h,nrhs,N);
+
+
+
+ 331 prestep(lev, mf_uold, mf_vold, mf_u, mf_v, mf_ru, mf_rv, mf_tempold, mf_saltold,
+
+ 333 mf_DC,
vec_t3[lev],
vec_s3[lev], mf_z_r, mf_z_w, mf_h, mf_sustr, mf_svstr, mf_bustr,
+ 334 mf_bvstr, iic, ntfirst, nnew, nstp, nrhs, N, dt_lev);
+
+
-
- 339 mf_W.FillBoundary(geom[lev].periodicity());
-
- 341 for ( MFIter mfi(mf_temp, TilingIfNotGPU()); mfi.isValid(); ++mfi )
-
- 343 Array4<Real>
const& DC = mf_DC.array(mfi);
- 344 Array4<Real>
const& Akv = (
vec_Akv[lev])->array(mfi);
- 345 Array4<Real>
const& Hz = (
vec_Hz[lev])->array(mfi);
- 346 Array4<Real>
const& Huon = (
vec_Huon[lev])->array(mfi);
- 347 Array4<Real>
const& Hvom = (
vec_Hvom[lev])->array(mfi);
- 348 Array4<Real>
const& z_r = (mf_z_r)->array(mfi);
- 349 Array4<Real>
const& z_w = (mf_z_w)->array(mfi);
- 350 Array4<Real>
const& uold = (mf_uold).array(mfi);
- 351 Array4<Real>
const& vold = (mf_vold).array(mfi);
- 352 Array4<Real>
const&
u = (mf_u).array(mfi);
- 353 Array4<Real>
const&
v = (mf_v).array(mfi);
- 354 Array4<Real>
const& pden = (mf_pden).array(mfi);
- 355 Array4<Real>
const& rho = (mf_rho).array(mfi);
- 356 Array4<Real>
const& rhoA = (mf_rhoA).array(mfi);
- 357 Array4<Real>
const& rhoS = (mf_rhoS).array(mfi);
- 358 Array4<Real>
const& tempold = (mf_tempold).array(mfi);
- 359 Array4<Real>
const& saltold = (mf_saltold).array(mfi);
- 360 Array4<Real>
const& temp = (mf_temp).array(mfi);
- 361 Array4<Real>
const& salt = (mf_salt).array(mfi);
- 362 Array4<Real>
const& tempstore = (
vec_t3[lev])->array(mfi);
- 363 Array4<Real>
const& saltstore = (
vec_s3[lev])->array(mfi);
- 364 Array4<Real>
const& ru = (mf_ru)->array(mfi);
- 365 Array4<Real>
const& rv = (mf_rv)->array(mfi);
- 366 Array4<Real>
const& rufrc = (mf_rufrc)->array(mfi);
- 367 Array4<Real>
const& rvfrc = (mf_rvfrc)->array(mfi);
- 368 Array4<Real>
const& W = (mf_W).array(mfi);
- 369 Array4<Real>
const& sustr = (mf_sustr)->array(mfi);
- 370 Array4<Real>
const& svstr = (mf_svstr)->array(mfi);
- 371 Array4<Real>
const& rdrag = (mf_rdrag)->array(mfi);
- 372 Array4<Real>
const& bustr = (mf_bustr)->array(mfi);
- 373 Array4<Real>
const& bvstr = (mf_bvstr)->array(mfi);
- 374 Array4<Real>
const& ubar = (mf_ubar)->array(mfi);
- 375 Array4<Real>
const& vbar = (mf_vbar)->array(mfi);
- 376 Array4<Real>
const& visc2_p = (mf_visc2_p)->array(mfi);
- 377 Array4<Real>
const& visc2_r = (mf_visc2_r)->array(mfi);
- 378 Array4<Real>
const& diff2_salt = (mf_diff2_salt)->array(mfi);
- 379 Array4<Real>
const& diff2_temp = (mf_diff2_temp)->array(mfi);
-
- 381 Array4<Real>
const& zeta = (
vec_zeta[lev])->array(mfi);
- 382 Array4<Real>
const& Zt_avg1 = (
vec_Zt_avg1[lev])->array(mfi);
-
- 384 Box bx = mfi.tilebox();
-
-
- 387 Box gbx = mfi.growntilebox();
- 388 Box gbx1 = mfi.growntilebox(IntVect(
NGROW-1,
NGROW-1,0));
- 389 Box gbx2 = mfi.growntilebox(IntVect(
NGROW,
NGROW,0));
-
-
-
-
-
-
-
-
-
-
-
-
-
- 403 Box ubx = surroundingNodes(bx,0);
- 404 Box vbx = surroundingNodes(bx,1);
-
-
-
-
-
-
-
-
-
-
-
-
-
- 418 tbxp1D.makeSlab(2,0);
-
- 420 tbxp2D.makeSlab(2,0);
-
-
-
- 424 FArrayBox fab_FC(gbx2,1,amrex::The_Async_Arena());
- 425 FArrayBox fab_FX(gbx2,1,amrex::The_Async_Arena());
- 426 FArrayBox fab_FE(gbx2,1,amrex::The_Async_Arena());
- 427 FArrayBox fab_BC(gbx2,1,amrex::The_Async_Arena());
- 428 FArrayBox fab_CF(gbx2,1,amrex::The_Async_Arena());
- 429 FArrayBox fab_pn(tbxp2D,1,amrex::The_Async_Arena());
- 430 FArrayBox fab_pm(tbxp2D,1,amrex::The_Async_Arena());
- 431 FArrayBox fab_on_u(tbxp2D,1,amrex::The_Async_Arena());
- 432 FArrayBox fab_om_v(tbxp2D,1,amrex::The_Async_Arena());
- 433 FArrayBox fab_om_u(tbxp2D,1,amrex::The_Async_Arena());
- 434 FArrayBox fab_on_v(tbxp2D,1,amrex::The_Async_Arena());
- 435 FArrayBox fab_om_r(tbxp2D,1,amrex::The_Async_Arena());
- 436 FArrayBox fab_on_r(tbxp2D,1,amrex::The_Async_Arena());
- 437 FArrayBox fab_om_p(tbxp2D,1,amrex::The_Async_Arena());
- 438 FArrayBox fab_on_p(tbxp2D,1,amrex::The_Async_Arena());
- 439 FArrayBox fab_pmon_u(tbxp2D,1,amrex::The_Async_Arena());
- 440 FArrayBox fab_pnom_u(tbxp2D,1,amrex::The_Async_Arena());
- 441 FArrayBox fab_pmon_v(tbxp2D,1,amrex::The_Async_Arena());
- 442 FArrayBox fab_pnom_v(tbxp2D,1,amrex::The_Async_Arena());
- 443 FArrayBox fab_fomn(tbxp2D,1,amrex::The_Async_Arena());
-
-
- 446 auto FC=fab_FC.array();
- 447 auto FX=fab_FX.array();
- 448 auto FE=fab_FE.array();
- 449 auto pn=fab_pn.array();
- 450 auto pm=fab_pm.array();
- 451 auto on_u=fab_on_u.array();
- 452 auto om_v=fab_om_v.array();
- 453 auto om_u=fab_om_u.array();
- 454 auto on_v=fab_on_v.array();
- 455 auto om_r=fab_om_r.array();
- 456 auto on_r=fab_on_r.array();
- 457 auto om_p=fab_om_p.array();
- 458 auto on_p=fab_on_p.array();
- 459 auto pmon_u=fab_pmon_u.array();
- 460 auto pnom_u=fab_pnom_u.array();
- 461 auto pmon_v=fab_pmon_v.array();
- 462 auto pnom_v=fab_pnom_v.array();
- 463 auto fomn=fab_fomn.array();
-
-
- 466 amrex::ParallelFor(tbxp2D,
- 467 [=] AMREX_GPU_DEVICE (
int i,
int j,
int )
-
-
-
-
-
-
- 474 Real Esize=1000*(Mm);
- 475 Real y = prob_lo[1] + (j + 0.5) * dx[1];
- 476 Real f=f0+beta*(
y-.5*Esize);
- 477 fomn(i,j,0)=f*(1.0/(pm(i,j,0)*pn(i,j,0)));
-
-
- 480 amrex::ParallelFor(tbxp2D,
- 481 [=] AMREX_GPU_DEVICE (
int i,
int j,
int )
-
-
- 484 om_v(i,j,0)=1.0/dxi[0];
- 485 on_u(i,j,0)=1.0/dxi[1];
- 486 om_r(i,j,0)=1.0/dxi[0];
- 487 on_r(i,j,0)=1.0/dxi[1];
-
- 489 om_p(i,j,0)=1.0/dxi[0];
- 490 on_p(i,j,0)=1.0/dxi[1];
- 491 on_v(i,j,0)=1.0/dxi[1];
- 492 om_u(i,j,0)=1.0/dxi[0];
-
-
-
-
-
-
- 499 amrex::ParallelFor(gbx2,
- 500 [=] AMREX_GPU_DEVICE (
int i,
int j,
int k)
-
-
-
-
- 505 prsgrd(gbx1,ru,rv,on_u,om_v,rho,FC,Hz,z_r,z_w,nrhs,N);
-
- 507 amrex::PrintToFile(
"ru_afterprsgrd").SetPrecision(18)<<FArrayBox(ru)<<std::endl;
- 508 amrex::PrintToFile(
"rv_afterprsgrd").SetPrecision(18)<<FArrayBox(rv)<<std::endl;
-
-
-
- 512 amrex::PrintToFile(
"temp_pret3dmix").SetPrecision(18)<<FArrayBox(temp) << std::endl;
- 513 amrex::PrintToFile(
"salt_pret3dmix").SetPrecision(18)<<FArrayBox(salt) << std::endl;
-
- 515 t3dmix(bx, temp, diff2_temp, Hz, pm, pn, pmon_u, pnom_v, nrhs, nnew, dt_lev);
- 516 t3dmix(bx, salt, diff2_salt, Hz, pm, pn, pmon_u, pnom_v, nrhs, nnew, dt_lev);
-
- 518 amrex::PrintToFile(
"temp_postt3dmix").SetPrecision(18)<<FArrayBox(temp) << std::endl;
- 519 amrex::PrintToFile(
"salt_postt3dmix").SetPrecision(18)<<FArrayBox(salt) << std::endl;
-
-
-
-
-
-
-
-
-
- 529 coriolis(bx, gbx, uold, vold, ru, rv, Hz, fomn, nrhs, nrhs);
-
-
- 532 amrex::PrintToFile(
"ru_aftercor").SetPrecision(18)<<FArrayBox(ru)<<std::endl;
- 533 amrex::PrintToFile(
"rv_aftercor").SetPrecision(18)<<FArrayBox(rv)<<std::endl;
- 534 amrex::PrintToFile(
"u_aftercor").SetPrecision(18)<<FArrayBox(
u)<<std::endl;
- 535 amrex::PrintToFile(
"v_aftercor").SetPrecision(18)<<FArrayBox(
v)<<std::endl;
- 536 amrex::PrintToFile(
"temp_aftercor").SetPrecision(18)<<FArrayBox(temp)<<std::endl;
- 537 amrex::PrintToFile(
"tempstore_aftercor").SetPrecision(18)<<FArrayBox(tempstore)<<std::endl;
- 538 amrex::PrintToFile(
"salt_aftercor").SetPrecision(18)<<FArrayBox(salt)<<std::endl;
- 539 amrex::PrintToFile(
"saltstore_aftercor").SetPrecision(18)<<FArrayBox(saltstore)<<std::endl;
-
-
-
-
-
-
-
-
-
-
- 550 rhs_3d(bx, gbx, uold, vold, ru, rv, rufrc, rvfrc, sustr, svstr, bustr, bvstr, Huon, Hvom, on_u, om_v, om_u, on_v, W, FC, nrhs, N);
-
- 552 amrex::PrintToFile(
"ru_afterrhs").SetPrecision(18)<<FArrayBox(ru)<<std::endl;
- 553 amrex::PrintToFile(
"rv_afterrhs").SetPrecision(18)<<FArrayBox(rv)<<std::endl;
- 554 amrex::PrintToFile(
"u_afterrhs").SetPrecision(18)<<FArrayBox(
u)<<std::endl;
- 555 amrex::PrintToFile(
"v_afterrhs").SetPrecision(18)<<FArrayBox(
v)<<std::endl;
-
-
-
-
-
-
- 562 uv3dmix(bx,
u,
v, uold, vold, rufrc, rvfrc, visc2_p, visc2_r, Hz, om_r, on_r, om_p, on_p, pm, pn, nrhs, nnew, dt_lev);
-
- 564 amrex::PrintToFile(
"ru_afteruvmix").SetPrecision(18)<<FArrayBox(ru)<<std::endl;
- 565 amrex::PrintToFile(
"rv_afteruvmix").SetPrecision(18)<<FArrayBox(rv)<<std::endl;
- 566 amrex::PrintToFile(
"u_afteruvmix").SetPrecision(18)<<FArrayBox(
u)<<std::endl;
- 567 amrex::PrintToFile(
"v_afteruvmix").SetPrecision(18)<<FArrayBox(
v)<<std::endl;
- 568 amrex::PrintToFile(
"Huon").SetPrecision(18)<<FArrayBox(Huon)<<std::endl;
- 569 amrex::PrintToFile(
"temp_uv3dmix").SetPrecision(18)<<FArrayBox(temp)<<std::endl;
- 570 amrex::PrintToFile(
"tempstore_uv3dmix").SetPrecision(18)<<FArrayBox(tempstore)<<std::endl;
- 571 amrex::PrintToFile(
"salt_uv3dmix").SetPrecision(18)<<FArrayBox(salt)<<std::endl;
- 572 amrex::PrintToFile(
"saltstore_uv3dmix").SetPrecision(18)<<FArrayBox(saltstore)<<std::endl;
+ 338 mf_W.FillBoundary(geom[lev].periodicity());
+
+ 340 for ( MFIter mfi(mf_temp, TilingIfNotGPU()); mfi.isValid(); ++mfi )
+
+ 342 Array4<Real>
const& DC = mf_DC.array(mfi);
+ 343 Array4<Real>
const& Akv = (
vec_Akv[lev])->array(mfi);
+ 344 Array4<Real>
const& Hz = (
vec_Hz[lev])->array(mfi);
+ 345 Array4<Real>
const& Huon = (
vec_Huon[lev])->array(mfi);
+ 346 Array4<Real>
const& Hvom = (
vec_Hvom[lev])->array(mfi);
+ 347 Array4<Real>
const& z_r = (mf_z_r)->array(mfi);
+ 348 Array4<Real>
const& z_w = (mf_z_w)->array(mfi);
+ 349 Array4<Real>
const& uold = (mf_uold).array(mfi);
+ 350 Array4<Real>
const& vold = (mf_vold).array(mfi);
+ 351 Array4<Real>
const&
u = (mf_u).array(mfi);
+ 352 Array4<Real>
const&
v = (mf_v).array(mfi);
+ 353 Array4<Real>
const& pden = (mf_pden).array(mfi);
+ 354 Array4<Real>
const& rho = (mf_rho).array(mfi);
+ 355 Array4<Real>
const& rhoA = (mf_rhoA).array(mfi);
+ 356 Array4<Real>
const& rhoS = (mf_rhoS).array(mfi);
+ 357 Array4<Real>
const& tempold = (mf_tempold).array(mfi);
+ 358 Array4<Real>
const& saltold = (mf_saltold).array(mfi);
+ 359 Array4<Real>
const& temp = (mf_temp).array(mfi);
+ 360 Array4<Real>
const& salt = (mf_salt).array(mfi);
+ 361 Array4<Real>
const& tempstore = (
vec_t3[lev])->array(mfi);
+ 362 Array4<Real>
const& saltstore = (
vec_s3[lev])->array(mfi);
+ 363 Array4<Real>
const& ru = (mf_ru)->array(mfi);
+ 364 Array4<Real>
const& rv = (mf_rv)->array(mfi);
+ 365 Array4<Real>
const& rufrc = (mf_rufrc)->array(mfi);
+ 366 Array4<Real>
const& rvfrc = (mf_rvfrc)->array(mfi);
+ 367 Array4<Real>
const& W = (mf_W).array(mfi);
+ 368 Array4<Real>
const& sustr = (mf_sustr)->array(mfi);
+ 369 Array4<Real>
const& svstr = (mf_svstr)->array(mfi);
+ 370 Array4<Real>
const& rdrag = (mf_rdrag)->array(mfi);
+ 371 Array4<Real>
const& bustr = (mf_bustr)->array(mfi);
+ 372 Array4<Real>
const& bvstr = (mf_bvstr)->array(mfi);
+ 373 Array4<Real>
const& ubar = (mf_ubar)->array(mfi);
+ 374 Array4<Real>
const& vbar = (mf_vbar)->array(mfi);
+ 375 Array4<Real>
const& visc2_p = (mf_visc2_p)->array(mfi);
+ 376 Array4<Real>
const& visc2_r = (mf_visc2_r)->array(mfi);
+ 377 Array4<Real>
const& diff2_salt = (mf_diff2_salt)->array(mfi);
+ 378 Array4<Real>
const& diff2_temp = (mf_diff2_temp)->array(mfi);
+
+ 380 Array4<Real>
const& zeta = (
vec_zeta[lev])->array(mfi);
+ 381 Array4<Real>
const& Zt_avg1 = (
vec_Zt_avg1[lev])->array(mfi);
+
+ 383 Box bx = mfi.tilebox();
+
+
+ 386 Box gbx = mfi.growntilebox();
+ 387 Box gbx1 = mfi.growntilebox(IntVect(
NGROW-1,
NGROW-1,0));
+ 388 Box gbx2 = mfi.growntilebox(IntVect(
NGROW,
NGROW,0));
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 402 Box ubx = surroundingNodes(bx,0);
+ 403 Box vbx = surroundingNodes(bx,1);
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 417 tbxp1D.makeSlab(2,0);
+
+ 419 tbxp2D.makeSlab(2,0);
+
+
+
+ 423 FArrayBox fab_FC(gbx2,1,amrex::The_Async_Arena());
+ 424 FArrayBox fab_FX(gbx2,1,amrex::The_Async_Arena());
+ 425 FArrayBox fab_FE(gbx2,1,amrex::The_Async_Arena());
+ 426 FArrayBox fab_BC(gbx2,1,amrex::The_Async_Arena());
+ 427 FArrayBox fab_CF(gbx2,1,amrex::The_Async_Arena());
+ 428 FArrayBox fab_pn(tbxp2D,1,amrex::The_Async_Arena());
+ 429 FArrayBox fab_pm(tbxp2D,1,amrex::The_Async_Arena());
+ 430 FArrayBox fab_on_u(tbxp2D,1,amrex::The_Async_Arena());
+ 431 FArrayBox fab_om_v(tbxp2D,1,amrex::The_Async_Arena());
+ 432 FArrayBox fab_om_u(tbxp2D,1,amrex::The_Async_Arena());
+ 433 FArrayBox fab_on_v(tbxp2D,1,amrex::The_Async_Arena());
+ 434 FArrayBox fab_om_r(tbxp2D,1,amrex::The_Async_Arena());
+ 435 FArrayBox fab_on_r(tbxp2D,1,amrex::The_Async_Arena());
+ 436 FArrayBox fab_om_p(tbxp2D,1,amrex::The_Async_Arena());
+ 437 FArrayBox fab_on_p(tbxp2D,1,amrex::The_Async_Arena());
+ 438 FArrayBox fab_pmon_u(tbxp2D,1,amrex::The_Async_Arena());
+ 439 FArrayBox fab_pnom_u(tbxp2D,1,amrex::The_Async_Arena());
+ 440 FArrayBox fab_pmon_v(tbxp2D,1,amrex::The_Async_Arena());
+ 441 FArrayBox fab_pnom_v(tbxp2D,1,amrex::The_Async_Arena());
+ 442 FArrayBox fab_fomn(tbxp2D,1,amrex::The_Async_Arena());
+
+
+ 445 auto FC=fab_FC.array();
+ 446 auto FX=fab_FX.array();
+ 447 auto FE=fab_FE.array();
+ 448 auto pn=fab_pn.array();
+ 449 auto pm=fab_pm.array();
+ 450 auto on_u=fab_on_u.array();
+ 451 auto om_v=fab_om_v.array();
+ 452 auto om_u=fab_om_u.array();
+ 453 auto on_v=fab_on_v.array();
+ 454 auto om_r=fab_om_r.array();
+ 455 auto on_r=fab_on_r.array();
+ 456 auto om_p=fab_om_p.array();
+ 457 auto on_p=fab_on_p.array();
+ 458 auto pmon_u=fab_pmon_u.array();
+ 459 auto pnom_u=fab_pnom_u.array();
+ 460 auto pmon_v=fab_pmon_v.array();
+ 461 auto pnom_v=fab_pnom_v.array();
+ 462 auto fomn=fab_fomn.array();
+
+
+ 465 amrex::ParallelFor(tbxp2D,
+ 466 [=] AMREX_GPU_DEVICE (
int i,
int j,
int )
+
+
+
+
+
+
+ 473 Real Esize=1000*(Mm);
+ 474 Real y = prob_lo[1] + (j + 0.5) * dx[1];
+ 475 Real f=f0+beta*(
y-.5*Esize);
+ 476 fomn(i,j,0)=f*(1.0/(pm(i,j,0)*pn(i,j,0)));
+
+
+ 479 amrex::ParallelFor(tbxp2D,
+ 480 [=] AMREX_GPU_DEVICE (
int i,
int j,
int )
+
+
+ 483 om_v(i,j,0)=1.0/dxi[0];
+ 484 on_u(i,j,0)=1.0/dxi[1];
+ 485 om_r(i,j,0)=1.0/dxi[0];
+ 486 on_r(i,j,0)=1.0/dxi[1];
+
+ 488 om_p(i,j,0)=1.0/dxi[0];
+ 489 on_p(i,j,0)=1.0/dxi[1];
+ 490 on_v(i,j,0)=1.0/dxi[1];
+ 491 om_u(i,j,0)=1.0/dxi[0];
+
+
+
+
+
+
+ 498 amrex::ParallelFor(gbx2,
+ 499 [=] AMREX_GPU_DEVICE (
int i,
int j,
int k)
+
+
+
+
+ 504 prsgrd(gbx1,ru,rv,on_u,om_v,rho,FC,Hz,z_r,z_w,nrhs,N);
+
+ 506 amrex::PrintToFile(
"ru_afterprsgrd").SetPrecision(18)<<FArrayBox(ru)<<std::endl;
+ 507 amrex::PrintToFile(
"rv_afterprsgrd").SetPrecision(18)<<FArrayBox(rv)<<std::endl;
+
+
+
+ 511 amrex::PrintToFile(
"temp_pret3dmix").SetPrecision(18)<<FArrayBox(temp) << std::endl;
+ 512 amrex::PrintToFile(
"salt_pret3dmix").SetPrecision(18)<<FArrayBox(salt) << std::endl;
+
+ 514 t3dmix(bx, temp, diff2_temp, Hz, pm, pn, pmon_u, pnom_v, nrhs, nnew, dt_lev);
+ 515 t3dmix(bx, salt, diff2_salt, Hz, pm, pn, pmon_u, pnom_v, nrhs, nnew, dt_lev);
+
+ 517 amrex::PrintToFile(
"temp_postt3dmix").SetPrecision(18)<<FArrayBox(temp) << std::endl;
+ 518 amrex::PrintToFile(
"salt_postt3dmix").SetPrecision(18)<<FArrayBox(salt) << std::endl;
+
+
+
+
+
+
+
+
+
+ 528 coriolis(bx, gbx, uold, vold, ru, rv, Hz, fomn, nrhs, nrhs);
+
+
+ 531 amrex::PrintToFile(
"ru_aftercor").SetPrecision(18)<<FArrayBox(ru)<<std::endl;
+ 532 amrex::PrintToFile(
"rv_aftercor").SetPrecision(18)<<FArrayBox(rv)<<std::endl;
+ 533 amrex::PrintToFile(
"u_aftercor").SetPrecision(18)<<FArrayBox(
u)<<std::endl;
+ 534 amrex::PrintToFile(
"v_aftercor").SetPrecision(18)<<FArrayBox(
v)<<std::endl;
+ 535 amrex::PrintToFile(
"temp_aftercor").SetPrecision(18)<<FArrayBox(temp)<<std::endl;
+ 536 amrex::PrintToFile(
"tempstore_aftercor").SetPrecision(18)<<FArrayBox(tempstore)<<std::endl;
+ 537 amrex::PrintToFile(
"salt_aftercor").SetPrecision(18)<<FArrayBox(salt)<<std::endl;
+ 538 amrex::PrintToFile(
"saltstore_aftercor").SetPrecision(18)<<FArrayBox(saltstore)<<std::endl;
+
+
+
+
+
+
+
+
+
+
+ 549 rhs_3d(bx, gbx, uold, vold, ru, rv, rufrc, rvfrc, sustr, svstr, bustr, bvstr, Huon, Hvom, on_u, om_v, om_u, on_v, W, FC, nrhs, N);
+
+ 551 amrex::PrintToFile(
"ru_afterrhs").SetPrecision(18)<<FArrayBox(ru)<<std::endl;
+ 552 amrex::PrintToFile(
"rv_afterrhs").SetPrecision(18)<<FArrayBox(rv)<<std::endl;
+ 553 amrex::PrintToFile(
"u_afterrhs").SetPrecision(18)<<FArrayBox(
u)<<std::endl;
+ 554 amrex::PrintToFile(
"v_afterrhs").SetPrecision(18)<<FArrayBox(
v)<<std::endl;
+
+
+
+
+
+
+ 561 uv3dmix(bx,
u,
v, uold, vold, rufrc, rvfrc, visc2_p, visc2_r, Hz, om_r, on_r, om_p, on_p, pm, pn, nrhs, nnew, dt_lev);
+
+ 563 amrex::PrintToFile(
"ru_afteruvmix").SetPrecision(18)<<FArrayBox(ru)<<std::endl;
+ 564 amrex::PrintToFile(
"rv_afteruvmix").SetPrecision(18)<<FArrayBox(rv)<<std::endl;
+ 565 amrex::PrintToFile(
"u_afteruvmix").SetPrecision(18)<<FArrayBox(
u)<<std::endl;
+ 566 amrex::PrintToFile(
"v_afteruvmix").SetPrecision(18)<<FArrayBox(
v)<<std::endl;
+ 567 amrex::PrintToFile(
"Huon").SetPrecision(18)<<FArrayBox(Huon)<<std::endl;
+ 568 amrex::PrintToFile(
"temp_uv3dmix").SetPrecision(18)<<FArrayBox(temp)<<std::endl;
+ 569 amrex::PrintToFile(
"tempstore_uv3dmix").SetPrecision(18)<<FArrayBox(tempstore)<<std::endl;
+ 570 amrex::PrintToFile(
"salt_uv3dmix").SetPrecision(18)<<FArrayBox(salt)<<std::endl;
+ 571 amrex::PrintToFile(
"saltstore_uv3dmix").SetPrecision(18)<<FArrayBox(saltstore)<<std::endl;
+
-
-
-
- 577 amrex::ParallelFor(gbx2D,
- 578 [=] AMREX_GPU_DEVICE (
int i,
int j,
int)
-
- 580 zeta(i,j,0,0) = Zt_avg1(i,j,0);
- 581 zeta(i,j,0,1) = Zt_avg1(i,j,0);
-
-
-
-
-
-
- 588 mf_temp.FillBoundary(geom[lev].periodicity());
- 589 mf_salt.FillBoundary(geom[lev].periodicity());
- 590 mf_tempold.FillBoundary(geom[lev].periodicity());
- 591 mf_saltold.FillBoundary(geom[lev].periodicity());
- 592 vec_t3[lev]->FillBoundary(geom[lev].periodicity());
- 593 vec_s3[lev]->FillBoundary(geom[lev].periodicity());
- 594 vec_Huon[lev]->FillBoundary(geom[lev].periodicity());
- 595 vec_Hvom[lev]->FillBoundary(geom[lev].periodicity());
-
-
- 598 bool predictor_2d_step=
true;
- 599 bool first_2d_step=(iic==ntfirst);
- 600 int nfast_counter=predictor_2d_step ?
nfast :
nfast-1;
-
-
-
-
- 605 for(
int my_iif = 0; my_iif < nfast_counter; my_iif++) {
- 606 first_2d_step=(my_iif==0);
-
- 608 predictor_2d_step=
true;
-
-
-
-
-
-
-
-
- 617 ncomp, dt_lev, dtfast_lev, predictor_2d_step, first_2d_step, my_iif,
nfast, next_indx1);
-
-
- 620 predictor_2d_step=
false;
- 621 if (my_iif < nfast_counter - 1) {
-
-
-
-
-
-
-
-
- 630 ncomp, dt_lev, dtfast_lev, predictor_2d_step, first_2d_step, my_iif,
nfast, next_indx1);
-
+
+
+ 576 amrex::ParallelFor(gbx2D,
+ 577 [=] AMREX_GPU_DEVICE (
int i,
int j,
int)
+
+ 579 zeta(i,j,0,0) = Zt_avg1(i,j,0);
+ 580 zeta(i,j,0,1) = Zt_avg1(i,j,0);
+
+
+
+
+
+
+ 587 mf_temp.FillBoundary(geom[lev].periodicity());
+ 588 mf_salt.FillBoundary(geom[lev].periodicity());
+ 589 mf_tempold.FillBoundary(geom[lev].periodicity());
+ 590 mf_saltold.FillBoundary(geom[lev].periodicity());
+ 591 vec_t3[lev]->FillBoundary(geom[lev].periodicity());
+ 592 vec_s3[lev]->FillBoundary(geom[lev].periodicity());
+ 593 vec_Huon[lev]->FillBoundary(geom[lev].periodicity());
+ 594 vec_Hvom[lev]->FillBoundary(geom[lev].periodicity());
+
+
+ 597 bool predictor_2d_step=
true;
+ 598 bool first_2d_step=(iic==ntfirst);
+ 599 int nfast_counter=predictor_2d_step ?
nfast :
nfast-1;
+
+
+
+
+ 604 for(
int my_iif = 0; my_iif < nfast_counter; my_iif++) {
+ 605 first_2d_step=(my_iif==0);
+
+ 607 predictor_2d_step=
true;
+
+
+
+
+
+
+
+
+ 616 ncomp, dt_lev, dtfast_lev, predictor_2d_step, first_2d_step, my_iif,
nfast, next_indx1);
+
+
+ 619 predictor_2d_step=
false;
+ 620 if (my_iif < nfast_counter - 1) {
+
+
+
+
+
+
+
+
+ 629 ncomp, dt_lev, dtfast_lev, predictor_2d_step, first_2d_step, my_iif,
nfast, next_indx1);
+
+
-
-
-
-
-
-
- 639 advance_3d(lev, mf_u, mf_v, mf_tempold, mf_saltold, mf_temp, mf_salt,
vec_t3[lev],
vec_s3[lev],
vec_ru[lev],
vec_rv[lev],
-
-
-
-
- 644 mf_Hzk,
vec_Akv[lev],
vec_Akt[lev],
vec_Hz[lev],
vec_Huon[lev],
vec_Hvom[lev],
vec_z_w[lev],
vec_hOfTheConfusingName[lev], ncomp, N, dt_lev);
-
- 646 U_new.FillBoundary(geom[lev].periodicity());
- 647 V_new.FillBoundary(geom[lev].periodicity());
-
- 649 U_old.FillBoundary(geom[lev].periodicity());
- 650 V_old.FillBoundary(geom[lev].periodicity());
-
- 652 mf_temp.FillBoundary(geom[lev].periodicity());
- 653 mf_salt.FillBoundary(geom[lev].periodicity());
-
- 655 mf_tempold.FillBoundary(geom[lev].periodicity());
- 656 mf_saltold.FillBoundary(geom[lev].periodicity());
-
- 658 vec_t3[lev]->FillBoundary(geom[lev].periodicity());
- 659 vec_s3[lev]->FillBoundary(geom[lev].periodicity());
-
- 661 for (
int lev = 0; lev <= finest_level; ++lev) {
-
-
-
- 665 #ifdef ROMSX_USE_PARTICLES
-
-
-
- 669 tracer_particles->AdvectWithUmac(Umac, lev, dt_lev, *
vec_z_phys_nd[0]);
-
-
+
+
+
+
+
+ 638 advance_3d(lev, mf_u, mf_v, mf_tempold, mf_saltold, mf_temp, mf_salt,
vec_t3[lev],
vec_s3[lev],
vec_ru[lev],
vec_rv[lev],
+
+
+
+
+ 643 mf_Hzk,
vec_Akv[lev],
vec_Akt[lev],
vec_Hz[lev],
vec_Huon[lev],
vec_Hvom[lev],
vec_z_w[lev],
vec_hOfTheConfusingName[lev], ncomp, N, dt_lev);
+
+ 645 U_new.FillBoundary(geom[lev].periodicity());
+ 646 V_new.FillBoundary(geom[lev].periodicity());
+
+ 648 U_old.FillBoundary(geom[lev].periodicity());
+ 649 V_old.FillBoundary(geom[lev].periodicity());
+
+ 651 mf_temp.FillBoundary(geom[lev].periodicity());
+ 652 mf_salt.FillBoundary(geom[lev].periodicity());
+
+ 654 mf_tempold.FillBoundary(geom[lev].periodicity());
+ 655 mf_saltold.FillBoundary(geom[lev].periodicity());
+
+ 657 vec_t3[lev]->FillBoundary(geom[lev].periodicity());
+ 658 vec_s3[lev]->FillBoundary(geom[lev].periodicity());
+
+ 660 for (
int lev = 0; lev <= finest_level; ++lev) {
+
+
+
+ 664 #ifdef ROMSX_USE_PARTICLES
+
+
+
+ 668 tracer_particles->AdvectWithUmac(Umac, lev, dt_lev, *
vec_z_phys_nd[0]);
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+