coriolis_adv_compute_tendencies Subroutine

public subroutine coriolis_adv_compute_tendencies(grid, metrics, this, ms, u_src, v_src, h_src, use_state_fluxes)

Per-layer Coriolis + advection dispatcher. Reads this%pv_variant and routes to the matching kernel body:

PV_VARIANT_SADOURNY_HK → coriolis_adv_compute_tendencies_hk (Arakawa-Hsu 1990 — wider 3-corner stencil, suppresses the Hollingsworth-Källén instability) PV_VARIANT_SADOURNY_ENERGY → coriolis_adv_compute_tendencies_sadourny_energy (Sadourny 1975 energy-conserving transport form, q·vh — MOM6 SADOURNY75_ENERGY) otherwise → coriolis_adv_compute_tendencies_sadourny (classical Sadourny 1975 enstrophy-conserving + al81)

Callers that want to pin to a specific variant can call _hk / _sadourny_energy directly; tests do this.

use_state_fluxes (optional, default .false.): consume the continuity-renormalised ms%mass_flux_*_layer transports in place of the kernel-internal u·h_face recompute — the MOM6 mass-consistent CorAdCalc. Only the sadourny_energy transport form honours it (config fail-loud enforces this).

Arguments

Type IntentOptional Attributes Name
type(hgrid_t), intent(in) :: grid
type(ocean_metrics_t), intent(in) :: metrics
type(coriolis_adv_t), intent(inout) :: this
type(multilayer_state_t), intent(in) :: ms
real(kind=wp), intent(in), optional :: u_src(:,:,:)

Optional velocity/thickness source override (SPEC §4 S3, split_scheme = "pred_corr"): the driver passes the step time-means ms%u_av_layer / v_av_layer / h_av_layer so the Coriolis-advection tendency is evaluated on the MOM6 u_av family, never the prognostic (MOM6’s CorAdCalc(u_av, v_av, h_av, ...)). All three must be passed together. Absent ⇒ prognostic arrays, bit-identical.

real(kind=wp), intent(in), optional :: v_src(:,:,:)

Optional velocity/thickness source override (SPEC §4 S3, split_scheme = "pred_corr"): the driver passes the step time-means ms%u_av_layer / v_av_layer / h_av_layer so the Coriolis-advection tendency is evaluated on the MOM6 u_av family, never the prognostic (MOM6’s CorAdCalc(u_av, v_av, h_av, ...)). All three must be passed together. Absent ⇒ prognostic arrays, bit-identical.

real(kind=wp), intent(in), optional :: h_src(:,:,:)

Optional velocity/thickness source override (SPEC §4 S3, split_scheme = "pred_corr"): the driver passes the step time-means ms%u_av_layer / v_av_layer / h_av_layer so the Coriolis-advection tendency is evaluated on the MOM6 u_av family, never the prognostic (MOM6’s CorAdCalc(u_av, v_av, h_av, ...)). All three must be passed together. Absent ⇒ prognostic arrays, bit-identical.

logical, intent(in), optional :: use_state_fluxes

Calls

proc~~coriolis_adv_compute_tendencies~~CallsGraph proc~coriolis_adv_compute_tendencies coriolis_adv_compute_tendencies proc~coriolis_adv_compute_tendencies_hk coriolis_adv_compute_tendencies_hk proc~coriolis_adv_compute_tendencies->proc~coriolis_adv_compute_tendencies_hk proc~coriolis_adv_compute_tendencies_sadourny coriolis_adv_compute_tendencies_sadourny proc~coriolis_adv_compute_tendencies->proc~coriolis_adv_compute_tendencies_sadourny proc~coriolis_adv_compute_tendencies_sadourny_energy coriolis_adv_compute_tendencies_sadourny_energy proc~coriolis_adv_compute_tendencies->proc~coriolis_adv_compute_tendencies_sadourny_energy local local proc~coriolis_adv_compute_tendencies_hk->local proc~hk_corner_h hk_corner_h proc~coriolis_adv_compute_tendencies_hk->proc~hk_corner_h proc~hk_pair_coef hk_pair_coef proc~coriolis_adv_compute_tendencies_hk->proc~hk_pair_coef proc~porous_narrow_3d porous_narrow_3d proc~coriolis_adv_compute_tendencies_hk->proc~porous_narrow_3d proc~coriolis_adv_compute_tendencies_sadourny->local proc~weno3_recon weno3_recon proc~coriolis_adv_compute_tendencies_sadourny->proc~weno3_recon proc~weno5_recon weno5_recon proc~coriolis_adv_compute_tendencies_sadourny->proc~weno5_recon proc~weno7_recon weno7_recon proc~coriolis_adv_compute_tendencies_sadourny->proc~weno7_recon proc~coriolis_adv_compute_tendencies_sadourny_energy->local proc~corner_abs_vort corner_abs_vort proc~coriolis_adv_compute_tendencies_sadourny_energy->proc~corner_abs_vort proc~coriolis_adv_compute_tendencies_sadourny_energy->proc~porous_narrow_3d proc~fac_weno fac_weno proc~weno3_recon->proc~fac_weno proc~beta5_0 beta5_0 proc~weno5_recon->proc~beta5_0 proc~beta5_1 beta5_1 proc~weno5_recon->proc~beta5_1 proc~beta5_2 beta5_2 proc~weno5_recon->proc~beta5_2 proc~weno5_recon->proc~fac_weno proc~beta7_0 beta7_0 proc~weno7_recon->proc~beta7_0 proc~beta7_1 beta7_1 proc~weno7_recon->proc~beta7_1 proc~beta7_2 beta7_2 proc~weno7_recon->proc~beta7_2 proc~beta7_3 beta7_3 proc~weno7_recon->proc~beta7_3 proc~weno7_recon->proc~fac_weno

Called by

proc~~coriolis_adv_compute_tendencies~~CalledByGraph proc~coriolis_adv_compute_tendencies coriolis_adv_compute_tendencies proc~run_stage run_stage proc~run_stage->proc~coriolis_adv_compute_tendencies proc~run_stage_split run_stage_split proc~run_stage_split->proc~coriolis_adv_compute_tendencies proc~ocean_dyn_step ocean_dyn_step proc~ocean_dyn_step->proc~run_stage proc~ocean_dyn_step_split ocean_dyn_step_split proc~ocean_dyn_step_split->proc~run_stage_split proc~engine_step engine_step proc~engine_step->proc~ocean_dyn_step proc~engine_step->proc~ocean_dyn_step_split proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~engine_step proc~rdb_ocean_step rdb_ocean_step proc~rdb_ocean_step->proc~engine_step proc~driver_run driver_run proc~driver_run->proc~driver_run_ocean

Variables

Type Visibility Attributes Name Initial
logical, private :: usf

Source Code

   subroutine coriolis_adv_compute_tendencies(grid, metrics, this, ms, u_src, v_src, h_src, &
                                              use_state_fluxes)
      !! Per-layer Coriolis + advection dispatcher.  Reads
      !! `this%pv_variant` and routes to the matching kernel body:
      !!
      !!   PV_VARIANT_SADOURNY_HK     → coriolis_adv_compute_tendencies_hk
      !!     (Arakawa-Hsu 1990 — wider 3-corner stencil, suppresses
      !!      the Hollingsworth-Källén instability)
      !!   PV_VARIANT_SADOURNY_ENERGY → coriolis_adv_compute_tendencies_sadourny_energy
      !!     (Sadourny 1975 energy-conserving transport form, q·vh —
      !!      MOM6 SADOURNY75_ENERGY)
      !!   otherwise                  → coriolis_adv_compute_tendencies_sadourny
      !!     (classical Sadourny 1975 enstrophy-conserving + al81)
      !!
      !! Callers that want to pin to a specific variant can call
      !! `_hk` / `_sadourny_energy` directly; tests do this.
      !!
      !! `use_state_fluxes` (optional, default .false.): consume the
      !! continuity-renormalised `ms%mass_flux_*_layer` transports in
      !! place of the kernel-internal `u·h_face` recompute — the MOM6
      !! mass-consistent CorAdCalc.  Only the `sadourny_energy`
      !! transport form honours it (config fail-loud enforces this).
      type(hgrid_t), intent(in) :: grid
      type(ocean_metrics_t), intent(in) :: metrics
      type(coriolis_adv_t), intent(inout) :: this
      type(multilayer_state_t), intent(in) :: ms
      ! assumed-shape-ok: outer-shim passthrough, resolved to explicit-shape
      ! dummies in the variant bodies; never indexed here.
      real(wp), intent(in), optional :: u_src(:, :, :), v_src(:, :, :), h_src(:, :, :)
         !! Optional velocity/thickness source override (SPEC §4 S3,
         !! `split_scheme = "pred_corr"`): the driver passes the step
         !! time-means `ms%u_av_layer` / `v_av_layer` / `h_av_layer` so the
         !! Coriolis-advection tendency is evaluated on the MOM6 `u_av`
         !! family, never the prognostic (MOM6's `CorAdCalc(u_av, v_av,
         !! h_av, ...)`).  All three must be
         !! passed together.  Absent ⇒ prognostic arrays, bit-identical.
      logical, intent(in), optional :: use_state_fluxes

      logical :: usf

      usf = .false.
      if (present(use_state_fluxes)) usf = use_state_fluxes

      if (present(u_src)) then
         if (this%pv_variant == PV_VARIANT_SADOURNY_HK) then
            call coriolis_adv_compute_tendencies_hk(grid, metrics, this, ms, &
                                                    u_src, v_src, h_src)
         else if (this%pv_variant == PV_VARIANT_SADOURNY_ENERGY) then
            call coriolis_adv_compute_tendencies_sadourny_energy(grid, metrics, this, ms, &
                                                                 u_src, v_src, h_src, &
                                                                 use_state_fluxes=usf)
         else
            call coriolis_adv_compute_tendencies_sadourny(grid, metrics, this, ms, &
                                                          u_src, v_src, h_src)
         end if
      else if (this%pv_variant == PV_VARIANT_SADOURNY_HK) then
         call coriolis_adv_compute_tendencies_hk(grid, metrics, this, ms, &
                                                 ms%u_face_x_layer, ms%v_face_y_layer, ms%h_layer)
      else if (this%pv_variant == PV_VARIANT_SADOURNY_ENERGY) then
         call coriolis_adv_compute_tendencies_sadourny_energy(grid, metrics, this, ms, &
                                                              ms%u_face_x_layer, ms%v_face_y_layer, ms%h_layer, &
                                                              use_state_fluxes=usf)
      else
         call coriolis_adv_compute_tendencies_sadourny(grid, metrics, this, ms, &
                                                       ms%u_face_x_layer, ms%v_face_y_layer, ms%h_layer)
      end if
   end subroutine coriolis_adv_compute_tendencies