AquaticEcoDynamics / GLM

Code for the General Lake Model
http://aquatic.science.uwa.edu.au/research/models/GLM/
GNU General Public License v3.0
35 stars 29 forks source link

Lake[].Epsilon is zero on day 1 #47

Closed rqthomas closed 2 weeks ago

rqthomas commented 3 months ago

https://github.com/AquaticEcoDynamics/GLM/blob/9fac22cbf9401ac08ee840c6239b6c992debd6aa/src/glm_flow.c#L248

Lake[Outflow_LayerNum].Epsilon is initialized to 0 for use in the outflow calculations and then set within deep_mixing in the subdaily loop. The outflow calculations in all subsequent days use the value updated by the subdaily loop (so not an issue for a multi-day run?). However, this means that a daily "hot start" always has a value of 0 for Epsilon. We need to move the code that sets Epsilon into the model initialization step. I think we should create a function in deep_mix.c called set_epsilon that can be called within glm_init.c. Thoughts @matthipsey?

rqthomas commented 2 weeks ago

We fixed this by moving the flows to be after the subdaily loop. We needed to adjust how the output was generated so that there was output after the flows were calculated.