This PR fixes two bugs in the Stokes drift module that in some cases the Langmuir numbers may be invalid values:
An invalid value of 0 could happen when the surface wind forcing is zero but the Stokes drift is not. This is now fixed by checking both the surface friction velocity u_taus and the surface magnitude of Stokes drift us_srf when computing the Langmuir numbers. A valid big number for Langmuir numbers is assigned when either u_taus or us_srf is very small (smaller than 1e-4).
An invalid value of NaN (taking the square root of a negative number) could happen for the surface layer averaged Langmuir number when the surface layer Stokes drift magnitude is smaller than that near the base of the boundary layer (could happen when a swell component exists that is to the opposite direction of the wind and cancels the wind wave component near the surface). This is fixed by taking the absolute value of the difference before taking the square root.
This PR fixes two bugs in the Stokes drift module that in some cases the Langmuir numbers may be invalid values:
u_taus
and the surface magnitude of Stokes driftus_srf
when computing the Langmuir numbers. A valid big number for Langmuir numbers is assigned when eitheru_taus
orus_srf
is very small (smaller than 1e-4).