pv_adv_required_nghost Function

public pure function pv_adv_required_nghost(code) result(ng)

Minimum nghost for a PV face-interp scheme: the stencil RADIUS + 1. weno5 (radius 3) -> 4, weno7 (radius 4) -> 5; centered and weno3 (radius 2) keep the nghost>=2 baseline – one rank has no seam, and every decomposed run is already floored at nghost>=3 (ocean_halo_init), which is weno3’s radius + 1 (measured bitwise, 2x2 / 4x1).

Why + 1: at nghost = radius a decomposed run is NOT bit-identical to one rank (weno7 at 4, weno5 at 3: last-bit drift in every owned cell on 2x2 / 4x1, under both split schemes; compat-matrix row decomp_weno_pv, now closed), and one ghost more is bitwise. In coriolis_adv_compute_tendencies_sadourny the u-face stencil reads the corners j-r+1 .. j+r (i-r+1 .. i+r on the v-faces), so at nghost = r the first/last owned face reaches corner 2 and corner ny/nx – the corners q_corner builds from the OUTERMOST ghost row/column of u/v (rows 1 and ny). That ring is not kept as the neighbour’s image (the end-of-step checkpoint differs there by O(0.1 m/s) from the serial run’s matching cells while every inner ring agrees), so the corner PV at the stencil’s edge is one ring short of valid. Radius + 1 keeps every corner the stencil reads off that ring. Mirrors the tracer-WENO ladder’s per-rung gate; configure fail-loud rejects an under-provisioned halo.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: code

Return Value integer


Called by

proc~~pv_adv_required_nghost~~CalledByGraph proc~pv_adv_required_nghost pv_adv_required_nghost proc~required_halo required_halo proc~required_halo->proc~pv_adv_required_nghost proc~validate_config validate_config proc~validate_config->proc~pv_adv_required_nghost proc~build_pending_handle build_pending_handle proc~build_pending_handle->proc~validate_config proc~rdb_ocean_required_halo rdb_ocean_required_halo proc~rdb_ocean_required_halo->proc~required_halo proc~rdb_ocean_create_from_string rdb_ocean_create_from_string proc~rdb_ocean_create_from_string->proc~build_pending_handle proc~rdb_ocean_create_pending rdb_ocean_create_pending proc~rdb_ocean_create_pending->proc~build_pending_handle

Source Code

   pure function pv_adv_required_nghost(code) result(ng)
      !! Minimum `nghost` for a PV face-interp scheme: the stencil RADIUS + 1.
      !! weno5 (radius 3) -> 4, weno7 (radius 4) -> 5; centered and weno3
      !! (radius 2) keep the nghost>=2 baseline -- one rank has no seam, and
      !! every decomposed run is already floored at nghost>=3 (`ocean_halo_init`),
      !! which is weno3's radius + 1 (measured bitwise, 2x2 / 4x1).
      !!
      !! Why + 1: at nghost = radius a decomposed run is NOT bit-identical to
      !! one rank (weno7 at 4, weno5 at 3: last-bit drift in every owned cell
      !! on 2x2 / 4x1, under both split schemes; compat-matrix row
      !! `decomp_weno_pv`, now closed), and one ghost more is bitwise.  In
      !! `coriolis_adv_compute_tendencies_sadourny` the u-face stencil reads
      !! the corners `j-r+1 .. j+r` (`i-r+1 .. i+r` on the v-faces), so at
      !! nghost = r the first/last owned face reaches corner 2 and corner
      !! `ny`/`nx` -- the corners `q_corner` builds from the OUTERMOST ghost
      !! row/column of `u`/`v` (rows 1 and `ny`).  That ring is not kept as
      !! the neighbour's image (the end-of-step checkpoint differs there by
      !! O(0.1 m/s) from the serial run's matching cells while every inner
      !! ring agrees), so the corner PV at the stencil's edge is one ring
      !! short of valid.  Radius + 1 keeps every corner the stencil reads off
      !! that ring.  Mirrors the tracer-WENO ladder's per-rung gate;
      !! `configure` fail-loud rejects an under-provisioned halo.
      integer, intent(in) :: code
      integer :: ng
      select case (code)
      case (PV_ADV_WENO5)
         ng = 4
      case (PV_ADV_WENO7)
         ng = 5
      case default
         ng = 2
      end select
   end function pv_adv_required_nghost