Floating overflow in function flow_depth (hydraulic.f90)
The following code causes floating overflow crash for extremely small Qin values (e.g., 2.e-114):
https://github.com/ESCOMP/mizuRoute/blob/64a49b0ffc3b584c253d8a8f93c9d01ebac5d6a6/route/build/src/hydraulic.f90#L409
Solved by changing the following line to: if (Qin>1.e-50_dp) then
https://github.com/ESCOMP/mizuRoute/blob/64a49b0ffc3b584c253d8a8f93c9d01ebac5d6a6/route/build/src/hydraulic.f90#L356
Choice of 1.e-50_dp was based on the value used here:
https://github.com/ESCOMP/mizuRoute/blob/64a49b0ffc3b584c253d8a8f93c9d01ebac5d6a6/route/build/src/tracer.f90#L291
An alternative could be 1.e-10_dp (unused variable so far):
https://github.com/ESCOMP/mizuRoute/blob/64a49b0ffc3b584c253d8a8f93c9d01ebac5d6a6/route/build/src/public_var.f90#L44
Hi Bernardo, I will need to sort this out. I did run into this problem before even before tracer was implemented. For 64bit, the smallest positive floating number can go even smaller than that
Hi @BernardoTeufel, I am having a difficulty re-producing this error with my test cases, and wondering if you could share yours, so I can test on my own.