Skip to content

Commit

Permalink
Fix code and fill Xriver array
Browse files Browse the repository at this point in the history
  • Loading branch information
CyprienBosserelle committed Sep 25, 2024
1 parent 65c82b6 commit 6c7489d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/InitialConditions.cu
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ template <class T> void InitRivers(Param XParam, Forcing<float> &XForcing, Model

// Fill them with a flag value
FillCPU(nribmax, nburmax, -1, XModel.bndblk.Riverinfo.Xbidir);
FillCPU(nribmax, nburmax, -1, XModel.bndblk.Riverinfo.Xbidir);
FillCPU(nribmax, nburmax, -1, XModel.bndblk.Riverinfo.Xridib);


std::vector<RiverBlk> blocksalreadyin;
Expand All @@ -421,8 +421,8 @@ template <class T> void InitRivers(Param XParam, Forcing<float> &XForcing, Model

}



//(n, 10)
std::vector<int> iriv(nribmax,0);
for (int Rin = 0; Rin < XForcing.rivers.size(); Rin++)
{
std::vector<int> uniqblockforriver = XForcing.rivers[Rin].block;
Expand All @@ -448,6 +448,11 @@ template <class T> void InitRivers(Param XParam, Forcing<float> &XForcing, Model
{
//not found;

XModel.bndblk.Riverinfo.Xbidir[iriv[iribm] + iribm * nburmax] = uniqblockforriver[bir];
XModel.bndblk.Riverinfo.Xridib[iriv[iribm] + iribm * nburmax] = Rin;

iriv[iribm] = iriv[iribm] + 1;

// add it to the list
blocksalreadyin[iribm].block.push_back(uniqblockforriver[bir]);

Expand Down

0 comments on commit 6c7489d

Please sign in to comment.