Largest dt (s) that keeps ocean_viscous_cfl_number at or
below limit, at fixed nu_h/dx_min — the “reduce dt below
…” half of the audit’s suggested fix.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | nu_h | |||
| real(kind=wp), | intent(in) | :: | dx_min | |||
| real(kind=wp), | intent(in) | :: | limit |
pure function ocean_viscous_cfl_max_dt(nu_h, dx_min, limit) result(dt_max) !! Largest `dt` (s) that keeps `ocean_viscous_cfl_number` at or !! below `limit`, at fixed `nu_h`/`dx_min` — the "reduce dt below !! ..." half of the audit's suggested fix. real(wp), intent(in) :: nu_h, dx_min, limit real(wp) :: dt_max if (nu_h > 0.0_wp) then dt_max = limit*dx_min**2/nu_h else dt_max = huge(1.0_wp) end if end function ocean_viscous_cfl_max_dt