Skip to content

Commit

Permalink
Merge pull request #768 from OpenWaterAnalytics/dev-tank_validation_b…
Browse files Browse the repository at this point in the history
…ug_fix

Update validate.c
  • Loading branch information
LRossman authored Jan 25, 2024
2 parents 5fd17af + 5c90eaf commit ade7027
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/validate.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Authors: see AUTHORS
Copyright: see AUTHORS
License: see LICENSE
Last Updated: 09/28/2023
Last Updated: 01/25/2024
******************************************************************************
*/

Expand Down Expand Up @@ -38,6 +38,7 @@ int validatetanks(Project *pr)
char errmsg[MAXMSG+1] = "";
Stank *tank;
Scurve *curve;
double elev;

for (j = 1; j <= net->Ntanks; j++)
{
Expand All @@ -52,13 +53,14 @@ int validatetanks(Project *pr)
) levelerr = 1;

// Check that tank heights are within volume curve
elev = net->Node[tank->Node].El;
i = tank->Vcurve;
if (i > 0)
{
curve = &net->Curve[i];
n = curve->Npts - 1;
if (tank->Hmin * pr->Ucf[ELEV] < curve->X[0] ||
tank->Hmax * pr->Ucf[ELEV]> curve->X[n])
if ((tank->Hmin - elev) * pr->Ucf[ELEV] < curve->X[0] ||
(tank->Hmax - elev) * pr->Ucf[ELEV]> curve->X[n])
{
levelerr = 1;
}
Expand Down

0 comments on commit ade7027

Please sign in to comment.