Skip to content

Commit

Permalink
add fill boundary for W and fix calculation of z_w at surface
Browse files Browse the repository at this point in the history
  • Loading branch information
hklion committed Sep 14, 2023
1 parent 59a74df commit 978b11e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions Source/TimeIntegration/ROMSX_Advance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,9 @@ ROMSX::Advance (int lev, Real time, Real dt_lev, int /*iteration*/, int /*ncycle
nstp, nrhs, N, dt_lev);
}


mf_W.FillBoundary(geom[lev].periodicity());

for ( MFIter mfi(mf_temp, TilingIfNotGPU()); mfi.isValid(); ++mfi )
{
Array4<Real> const& DC = mf_DC.array(mfi);
Expand Down
9 changes: 6 additions & 3 deletions Source/Utils/DepthStretchTransform.H
Original file line number Diff line number Diff line change
Expand Up @@ -370,14 +370,17 @@ ROMSX::stretch_transform (int lev)
cff2_w=(cff_w+cff1_w*hwater)*hinv;

if(k==0) {
z_w(i,j,N-1)=0.0;
// HACK: should actually be the normal expression with coeffs evaluated at k=N-1
z_w(i,j,N-1)=Zt_avg1(i,j,0);
}
else if(k==-1)
h(i,j,0,1)=Zt_avg1(i,j,0)+(Zt_avg1(i,j,0)+hwater)*cff2_w;
else
else {
z_w(i,j,k-1)=Zt_avg1(i,j,0)+(Zt_avg1(i,j,0)+hwater)*cff2_w;
if(k!=-1)
}
if(k!=-1) {
z_r(i,j,k)=Zt_avg1(i,j,0)+(Zt_avg1(i,j,0)+hwater)*cff2_r;
}
}
}
});
Expand Down

0 comments on commit 978b11e

Please sign in to comment.