Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/glm_flow.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ void do_single_outflow(AED_REAL HeightOfOutflow, AED_REAL flow, OutflowDataType
* Loop through all outflows and process - return the difference between *
* total volume before and after. *
******************************************************************************/
AED_REAL do_outflows(int jday)
AED_REAL do_outflows(int jday, AED_REAL day_fraction)
{
int i;
AED_REAL DrawHeight = -1; //# Height of withdraw [m from bottom]
Expand Down Expand Up @@ -461,12 +461,12 @@ AED_REAL do_outflows(int jday)
if (seepage) {
if (seepage_rate>zero) {
// Darcy's Law used, so input rate is hydraulic conductivity (m/day) x hydraulic head
SeepDraw = seepage_rate * Lake[surfLayer].Height * Lake[surfLayer].LayerArea * 0.95;
SeepDraw = seepage_rate * Lake[surfLayer].Height * Lake[surfLayer].LayerArea * 0.95 * day_fraction;
} else {
// Constant seepage assumed, so input rate is dh (m/day)
// 0.95 added since the effective area of seeping is probably
// a bit less than max area of water innundation???
SeepDraw = -seepage_rate * Lake[surfLayer].LayerArea * 0.95;
SeepDraw = -seepage_rate * Lake[surfLayer].LayerArea * 0.95 * day_fraction;
}
do_single_outflow(0., SeepDraw, NULL);
}
Expand All @@ -482,7 +482,7 @@ AED_REAL do_outflows(int jday)
* level. Add in stack volumes when calculating overflow. *
* After overflow, delete stack volumes from the structure. *
******************************************************************************/
AED_REAL do_overflow(int jday)
AED_REAL do_overflow(int jday, AED_REAL day_fraction)
{
AED_REAL VolSum = Lake[surfLayer].Vol1;
AED_REAL DrawHeight = 0.;
Expand All @@ -501,7 +501,7 @@ AED_REAL do_overflow(int jday)
AED_REAL ovfl_Q, ovfl_dz;

ovfl_dz = MAX( Lake[surfLayer].Height - CrestHeight, zero );
ovfl_Q = 2./3. * crest_factor * pow(2*g,0.5) * crest_width * pow(ovfl_dz,1.5);
ovfl_Q = 2./3. * crest_factor * pow(2*g,0.5) * crest_width * pow(ovfl_dz,1.5) * day_fraction * iSecsPerDay;
ovfl_Q = MIN( (VolSum - VolAtCrest) , ovfl_Q );

do_single_outflow(CrestHeight, ovfl_Q , NULL);
Expand Down
4 changes: 2 additions & 2 deletions src/glm_flow.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@

#include "glm.h"

AED_REAL do_outflows(int jday);
AED_REAL do_overflow(int jday);
AED_REAL do_outflows(int jday, AED_REAL day_fraction);
AED_REAL do_overflow(int jday, AED_REAL day_fraction);
AED_REAL do_inflows(void);

#endif
4 changes: 2 additions & 2 deletions src/glm_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -1569,8 +1569,8 @@ void initialise_lake(int namlst)
Lake[i].Salinity = the_sals[i];
}

if (the_heights[num_heights-1] > CrestHeight) {
fprintf(stderr, " ERROR: maximum height is greater than crest level\n");
if (the_heights[num_heights-1] > MaxHeight) {
fprintf(stderr, " ERROR: initial first height of %f is greater than maximum height of %f \n", the_heights[num_heights-1], MaxHeight);
exit(1);
}
num_depths = num_heights;
Expand Down
Loading