Too much precipitation crashes the simulation
When you get the warning "Watflow: topsoil too wet, and can not take up precipitation, assuming runoff.", the simulation seems to consistently crash with the error message "MichaelisMenten: Fluxdensity is not a number. Debugging info: 0.032382 0.059691 -nan 0.000448".
Lines 543 of 550 of Watflow.cpp, imply that excess water is assumed to disappear through runoff but this does not appear to work correctly. These lines are:
} else if (hNew[n] >= hCritS && rTop<0.) { // Infiltration capacity is exceeded msg::warning("Watflow: topsoil too wet, and can not take up precipitation, assuming runoff."); hNew[n] = hCritS; Adiag_boundary_nodes_[n]=(*SSM)(n,n); SSM->insert(n, n, 10.e30); // fill diagonal RHS[n] = 10.e30 * hNew[n]; // rhs Q[n] = 0.; //Computed later }
I don't fully understand what these lines are supposed to do but they only change the hydraulic heads in the topmost layer of soil nodes. I think that too high hydraulic head values can already have propagated to other soil nodes by the time these lines are evaluated.
Perhaps a better solution is reducing the precipitation value by a sufficiently large amount and rerunning the calculation of hNew. I'm not sure how this should be implemented.