Skip to content

Commit

Permalink
Fix zsoffset
Browse files Browse the repository at this point in the history
  • Loading branch information
CyprienBosserelle committed Feb 4, 2025
1 parent a835af5 commit 9ba730a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/Boundary.cu
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,9 @@ template <class T> __global__ void bndFluxGPUSide(Param XParam, bndsegmentside s
}





zsbnd = zsbnd + XParam.zsoffset;


int inside = Inside(halowidth, blkmemwidth, side.isright, side.istop, ix, iy, ib);

Expand Down Expand Up @@ -443,6 +443,9 @@ template <class T> void bndFluxGPUSideCPU(Param XParam, bndsegmentside side, Blo
zsbnd = interp2BUQ(XParam.xo + xx, XParam.yo + yy, Zsmap);
}


zsbnd = zsbnd + XParam.zsoffset;


int i = memloc(halowidth, blkmemwidth, ix, iy, ib);
int inside = Inside(halowidth, blkmemwidth, side.isright, side.istop, ix, iy, ib);
Expand Down
4 changes: 2 additions & 2 deletions src/InitEvolv.cu
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ template <class T> void initevolv(Param XParam, BlockP<T> XBlock,Forcing<float>
hotstartsucess = readhotstartfile(XParam, XBlock, XEv, zb);

//add offset if present
if (!std::isnan(XParam.zsoffset)) // apply specified zsoffset
if (T(XParam.zsoffset) != T(0.0)) // apply specified zsoffset
{
printf("\t\tadd offset to zs and hh... ");
//
Expand Down Expand Up @@ -104,7 +104,7 @@ template <class T>
int coldstart(Param XParam, BlockP<T> XBlock, T* zb, EvolvingP<T> & XEv)
{
T zzini = std::isnan(XParam.zsinit)? T(0.0): T(XParam.zsinit);
T zzoffset = std::isnan(XParam.zsoffset) ? T(0.0) : T(XParam.zsoffset);
T zzoffset = T(XParam.zsoffset);



Expand Down
6 changes: 6 additions & 0 deletions src/ReadInput.cu
Original file line number Diff line number Diff line change
Expand Up @@ -1135,6 +1135,12 @@ void checkparamsanity(Param& XParam, Forcing<float>& XForcing)
XParam.blkmemwidth = XParam.blkwidth + 2 * XParam.halowidth;
XParam.blksize = utils::sq(XParam.blkmemwidth);

///////////////////////////////////////////
// zsoffset
///////////////////////////////////////////

XParam.zsoffset = std::isnan(XParam.zsoffset) ? 0.0 : XParam.zsoffset;

///////////////////////////////////////////
// Read Bathy Information
///////////////////////////////////////////
Expand Down

0 comments on commit 9ba730a

Please sign in to comment.