Skip to content

Commit

Permalink
Merge pull request #274 from hklion/adjust_bounds_ncbounds
Browse files Browse the repository at this point in the history
adjust bounds in netcdf boundary conditions
  • Loading branch information
hklion authored Oct 18, 2024
2 parents d034254 + dcb0ca8 commit 2c9b320
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Source/BoundaryConditions/BoundaryConditions_netcdf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ REMORA::fill_from_bdyfiles (MultiFab& mf_to_fill, const MultiFab& mf_mask, const
const amrex::BCRec* bc_ptr = bcrs_d.data();

if (!xlo.isEmpty()) {
ParallelFor(xlo, [=] AMREX_GPU_DEVICE (int i, int j, int k)
ParallelFor(grow(xlo,IntVect(0,-1,0)), [=] AMREX_GPU_DEVICE (int i, int j, int k)
{
Real bry_val = (oma * bdatxlo_n (ubound(xlo).x,j,k,0)
+ alpha * bdatxlo_np1(ubound(xlo).x,j,k,0));
Expand Down Expand Up @@ -220,7 +220,7 @@ REMORA::fill_from_bdyfiles (MultiFab& mf_to_fill, const MultiFab& mf_mask, const
}

if (!xhi.isEmpty()) {
ParallelFor(xhi, [=] AMREX_GPU_DEVICE (int i, int j, int k)
ParallelFor(grow(xhi,IntVect(0,-1,0)), [=] AMREX_GPU_DEVICE (int i, int j, int k)
{
Real bry_val = (oma * bdatxhi_n (lbound(xhi).x,j,k,0)
+ alpha * bdatxhi_np1(lbound(xhi).x,j,k,0));
Expand Down Expand Up @@ -274,7 +274,7 @@ REMORA::fill_from_bdyfiles (MultiFab& mf_to_fill, const MultiFab& mf_mask, const
}

if (!ylo.isEmpty()) {
ParallelFor(ylo, [=] AMREX_GPU_DEVICE (int i, int j, int k)
ParallelFor(grow(ylo,IntVect(-1,0,0)), [=] AMREX_GPU_DEVICE (int i, int j, int k)
{
Real bry_val = (oma * bdatylo_n (i,ubound(ylo).y,k,0)
+ alpha * bdatylo_np1(i,ubound(ylo).y,k,0));
Expand Down Expand Up @@ -329,7 +329,7 @@ REMORA::fill_from_bdyfiles (MultiFab& mf_to_fill, const MultiFab& mf_mask, const
}

if (!yhi.isEmpty()) {
ParallelFor(yhi, [=] AMREX_GPU_DEVICE (int i, int j, int k)
ParallelFor(grow(yhi,IntVect(-1,0,0)), [=] AMREX_GPU_DEVICE (int i, int j, int k)
{
Real bry_val = (oma * bdatyhi_n (i,lbound(yhi).y,k,0)
+ alpha * bdatyhi_np1(i,lbound(yhi).y,k,0)) * mask_arr(i,j,0);
Expand Down
2 changes: 0 additions & 2 deletions Source/Initialization/REMORA_init_bcs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,6 @@ void REMORA::init_bcs ()
domain_bcs_type[BCVars::ubar_bc+i].setLo(dir, REMORABCType::foextrap);
domain_bcs_type[BCVars::u2d_simple_bc+i].setLo(dir, REMORABCType::foextrap);
if (i==1 and dir!=2) {
Print() << domain_bcs_type.size() << " u2dsimple " << BCVars::u2d_simple_bc << " " << dir << std::endl;
// Only normal direction has ext_dir
domain_bcs_type[BCVars::ubar_bc+dir].setLo(dir, REMORABCType::ext_dir);
domain_bcs_type[BCVars::u2d_simple_bc+dir].setLo(dir, REMORABCType::ext_dir);
Expand Down Expand Up @@ -585,7 +584,6 @@ void REMORA::init_bcs ()
}
else if (bct == REMORA_BC::chapman)
{
Print() << "in chapman " << BCVars::zeta_bc+i << std::endl;
if (side == Orientation::low) {
domain_bcs_type[BCVars::zeta_bc+i].setLo(dir, REMORABCType::chapman);
} else {
Expand Down

0 comments on commit 2c9b320

Please sign in to comment.