Closed martynpclark closed 3 years ago
Just for completeness, epsilon(stabilityCorrection)
is a small number (epsilon) of type stabilityCorrection, i.e., EPSILON(X) returns the smallest number E of the same kind as X such that 1 + E > 1.
Oh I see - I did not realize fortran had an intrinsic function for that purpose. Disregard - I'll approve and merge the PR.
The "standard" option for the stability correction is zero above the critical Richardson number. This provides an angle discontinuity -- close to the critical Richardson number values. The other stability corrections are more smooth.
To reduce numerical problems, the stability correction for the "standard" option sets stability to epsilon (~10^-16) if the bulk Richardson number is higher than the critical Richardson number. This still causes convergence problems. Suggest a minor modification to set the stability correction to 10^-10 if the Richardson number is above the critical value.