File tree 4 files changed +5
-9
lines changed
4 files changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -1789,8 +1789,7 @@ double getImpervAreaRunoff(int j)
1789
1789
{
1790
1790
q *= Subcatch [j ].subArea [IMPERV0 ].fOutlet ;
1791
1791
}
1792
- nonLidArea = Subcatch [j ].area - Subcatch [j ].lidArea ;
1793
- nonLidArea = 0.0 < nonLidArea ? 0.0 : nonLidArea ;
1792
+ nonLidArea = MAX (0.0 , Subcatch [j ].area - Subcatch [j ].lidArea );
1794
1793
return q * nonLidArea ;
1795
1794
}
1796
1795
@@ -1816,7 +1815,7 @@ double getPervAreaRunoff(int j)
1816
1815
{
1817
1816
q *= Subcatch [j ].subArea [PERV ].fOutlet ;
1818
1817
}
1819
- nonLidArea = max (0.0 , Subcatch [j ].area - Subcatch [j ].lidArea );
1818
+ nonLidArea = MAX (0.0 , Subcatch [j ].area - Subcatch [j ].lidArea );
1820
1819
return q * nonLidArea ;
1821
1820
}
1822
1821
Original file line number Diff line number Diff line change @@ -250,8 +250,7 @@ void findNodeQual(int j)
250
250
251
251
// --- Calculate bounded externally provided api pollutant flux and update mass balance
252
252
// --- Positive fluxes are added in the addExternalInflows function in routing.c (This really needs to be refactored for consistency)
253
- cOut = - Node [j ].apiExtQualMassFlux [p ] / qNode ;
254
- cOut = cOut < 0.0 ? 0.0 : cOut > cIn ? cIn : cOut ;
253
+ cOut = MIN (cIn , MAX (0.0 , - Node [j ].apiExtQualMassFlux [p ] / qNode ));
255
254
cIn -= cOut ;
256
255
massbal_addOutflowQual (p , cOut * qNode , FALSE);
257
256
Original file line number Diff line number Diff line change @@ -675,8 +675,7 @@ double subcatch_getRunoff(int j, double tStep)
675
675
// --- find volume of inflow to non-LID portion of subcatchment as existing
676
676
// ponded water + any runon volume from upstream areas;
677
677
// rainfall and snowmelt will be added as each sub-area is analyzed
678
- nonLidArea = Subcatch [j ].area - Subcatch [j ].lidArea ;
679
- nonLidArea = nonLidArea < 0.0 ? 0.0 : nonLidArea ;
678
+ nonLidArea = MAX (0.0 , Subcatch [j ].area - Subcatch [j ].lidArea );
680
679
vRunon = Subcatch [j ].runon * tStep * nonLidArea ;
681
680
Vinflow = vRunon + subcatch_getDepth (j ) * nonLidArea ;
682
681
Original file line number Diff line number Diff line change @@ -128,8 +128,7 @@ void surfqual_getBuildup(int j, double tStep)
128
128
newBuildup = MAX (newBuildup , oldBuildup );
129
129
130
130
//--- add bounded building from external API
131
- newBuildup = newBuildup + Subcatch [j ].apiExtBuildup [p ] * area ;
132
- newBuildup = newBuildup < 0.0 ? 0.0 : newBuildup ;
131
+ newBuildup = MAX (0.0 , newBuildup + Subcatch [j ].apiExtBuildup [p ] * area );
133
132
134
133
Subcatch [j ].landFactor [i ].buildup [p ] = newBuildup ;
135
134
massbal_updateLoadingTotals (BUILDUP_LOAD , p ,
You can’t perform that action at this time.
0 commit comments