cfl_cell_value Function

private pure function cfl_cell_value(u_l, u_r, v_l, v_r, idx, idy, dt) result(cfl)

Per-cell advective CFL from the C-grid face-velocity pairs and metric inverses: cfl = (|u_c|·idx + |v_c|·idy)·dt, with u_c/v_c the face averages. !$acc routine seq so it inlines into the reduction loops below — same module ⇒ NVHPC keeps it inlined (and it’s a status-cadence cold path regardless). Sole home of the CFL formula, shared by the gated + un-gated compute_max_cfl loops.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: u_l
real(kind=wp), intent(in) :: u_r
real(kind=wp), intent(in) :: v_l
real(kind=wp), intent(in) :: v_r
real(kind=wp), intent(in) :: idx
real(kind=wp), intent(in) :: idy
real(kind=wp), intent(in) :: dt

Return Value real(kind=wp)


Called by

proc~~cfl_cell_value~~CalledByGraph proc~cfl_cell_value cfl_cell_value proc~compute_max_cfl compute_max_cfl proc~compute_max_cfl->proc~cfl_cell_value proc~ocean_console_stats_report ocean_console_stats_report proc~ocean_console_stats_report->proc~compute_max_cfl proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~ocean_console_stats_report proc~driver_run driver_run proc~driver_run->proc~driver_run_ocean

Variables

Type Visibility Attributes Name Initial
real(kind=wp), private :: uc
real(kind=wp), private :: vc

Source Code

   pure function cfl_cell_value(u_l, u_r, v_l, v_r, idx, idy, dt) result(cfl)
      !! Per-cell advective CFL from the C-grid face-velocity pairs and metric
      !! inverses: `cfl = (|u_c|·idx + |v_c|·idy)·dt`, with `u_c`/`v_c` the
      !! face averages.  `!$acc routine seq` so it inlines into the reduction
      !! loops below — same module ⇒ NVHPC keeps it inlined (and it's a
      !! status-cadence cold path regardless).  Sole home of the CFL formula,
      !! shared by the gated + un-gated `compute_max_cfl` loops.
      !$acc routine seq
      real(wp), intent(in) :: u_l, u_r, v_l, v_r, idx, idy, dt
      real(wp) :: cfl, uc, vc
      uc = 0.5_wp*(u_l + u_r)
      vc = 0.5_wp*(v_l + v_r)
      cfl = (abs(uc)*idx + abs(vc)*idy)*dt
   end function cfl_cell_value