ocean_viscous_cfl_max_dt Function

public 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.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: nu_h
real(kind=wp), intent(in) :: dx_min
real(kind=wp), intent(in) :: limit

Return Value real(kind=wp)


Called by

proc~~ocean_viscous_cfl_max_dt~~CalledByGraph proc~ocean_viscous_cfl_max_dt ocean_viscous_cfl_max_dt proc~ocean_stability_audit ocean_stability_audit proc~ocean_stability_audit->proc~ocean_viscous_cfl_max_dt proc~engine_setup engine_setup proc~engine_setup->proc~ocean_stability_audit proc~complete_ocean_create complete_ocean_create proc~complete_ocean_create->proc~engine_setup proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~engine_setup proc~driver_validate driver_validate proc~driver_validate->proc~engine_setup proc~driver_run driver_run proc~driver_run->proc~driver_run_ocean proc~rdb_ocean_create_finalize rdb_ocean_create_finalize proc~rdb_ocean_create_finalize->proc~complete_ocean_create proc~rdb_ocean_create_from_string rdb_ocean_create_from_string proc~rdb_ocean_create_from_string->proc~complete_ocean_create

Source Code

   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