ocean_vcoord_eta0_target Subroutine

public pure subroutine ocean_vcoord_eta0_target(vc, target_h, total_h, nx, ny, nz)

The target layer thickness at eta = 0 of a GEOMETRIC family that vanishes layers — the ONE definition of “live” that the partial-step face mask (configure_ocean_closed_faces) and the on-target initial seed share with the running ALE regrid.

  • VCOORD_Z_FIXED — ocean_vcoord_z_fixed_target with the slot’s nominal layering (uniform z_fixed_h_ref/nz or the stretched z_fixed_zi/z_fixed_dz profile) and its rigid top z_top: exactly the call configure_ocean_closed_faces has always made, argument for argument.
  • VCOORD_ZSTAR_FULL — the ZSTAR_FULL branch of ocean_vcoord_geometric_target, the kernel compute_target_h dispatches to every regrid, walking the per-column z_ref table build_zref_full laid from the bathymetry. The caller must have built that table first.
  • VCOORD_ZSTAR — ocean_vcoord_zstar_target, the kernel the regrid dispatches to, at eta = 0 (where it is the z_fixed target with z_top = 0, bit for bit). Its live/filler pattern is decided at eta = 0 inside the kernel, so it is EXACTLY the pattern of every later regrid, of either sign of eta.

Any other family leaves target_h untouched (the caller refuses it before getting here). Configure / seed time only: the host arrays are local, so the do concurrent kernels underneath get their own implicit data regions.

Arguments

Type IntentOptional Attributes Name
type(ocean_vcoord_t), intent(in) :: vc

The vertical-coordinate slot (coord_type + every table).

real(kind=wp), intent(inout) :: target_h(nx,ny,nz)

Target thickness at eta = 0 (m), bottom-up.

real(kind=wp), intent(in) :: total_h(nx,ny)

Reference column thickness (m) — bt_H_ref at configure, the seed’s water column at IC time.

integer, intent(in) :: nx

i-extent (total, incl. halos).

integer, intent(in) :: ny

j-extent (total, incl. halos).

integer, intent(in) :: nz

Number of layers; k = 1 is the bed.


Calls

proc~~ocean_vcoord_eta0_target~~CallsGraph proc~ocean_vcoord_eta0_target ocean_vcoord_eta0_target proc~ocean_vcoord_geometric_target ocean_vcoord_geometric_target proc~ocean_vcoord_eta0_target->proc~ocean_vcoord_geometric_target proc~ocean_vcoord_z_fixed_target ocean_vcoord_z_fixed_target proc~ocean_vcoord_eta0_target->proc~ocean_vcoord_z_fixed_target proc~ocean_vcoord_zstar_target ocean_vcoord_zstar_target proc~ocean_vcoord_eta0_target->proc~ocean_vcoord_zstar_target local local proc~ocean_vcoord_geometric_target->local proc~ocean_vcoord_z_fixed_target->local proc~ocean_vcoord_zstar_target->local

Called by

proc~~ocean_vcoord_eta0_target~~CalledByGraph proc~ocean_vcoord_eta0_target ocean_vcoord_eta0_target proc~configure_ocean_closed_faces configure_ocean_closed_faces proc~configure_ocean_closed_faces->proc~ocean_vcoord_eta0_target proc~ocean_state_seed_from_cfg ocean_state_seed_from_cfg proc~ocean_state_seed_from_cfg->proc~ocean_vcoord_eta0_target proc~engine_setup engine_setup proc~engine_setup->proc~configure_ocean_closed_faces proc~engine_setup->proc~ocean_state_seed_from_cfg 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

Variables

Type Visibility Attributes Name Initial
real(kind=wp), private, allocatable :: eta0(:,:)
real(kind=wp), private :: h_nominal

Source Code

   pure subroutine ocean_vcoord_eta0_target(vc, target_h, total_h, nx, ny, nz)
      !! The target layer thickness at `eta = 0` of a GEOMETRIC family
      !! that vanishes layers — the ONE definition of "live" that the
      !! partial-step face mask (`configure_ocean_closed_faces`) and the
      !! on-target initial seed share with the running ALE regrid.
      !!
      !! * `VCOORD_Z_FIXED` — `ocean_vcoord_z_fixed_target` with the
      !!   slot's nominal layering (uniform `z_fixed_h_ref/nz` or the
      !!   stretched `z_fixed_zi`/`z_fixed_dz` profile) and its rigid top
      !!   `z_top`: exactly the call `configure_ocean_closed_faces` has
      !!   always made, argument for argument.
      !! * `VCOORD_ZSTAR_FULL` — the `ZSTAR_FULL` branch of
      !!   `ocean_vcoord_geometric_target`, the kernel
      !!   `compute_target_h` dispatches to every regrid, walking the
      !!   per-column `z_ref` table `build_zref_full` laid from the
      !!   bathymetry.  The caller must have built that table first.
      !! * `VCOORD_ZSTAR` — `ocean_vcoord_zstar_target`, the kernel the
      !!   regrid dispatches to, at `eta = 0` (where it is the `z_fixed`
      !!   target with `z_top = 0`, bit for bit).  Its live/filler pattern
      !!   is decided at `eta = 0` inside the kernel, so it is EXACTLY the
      !!   pattern of every later regrid, of either sign of `eta`.
      !!
      !! Any other family leaves `target_h` untouched (the caller refuses
      !! it before getting here).  Configure / seed time only: the host
      !! arrays are local, so the `do concurrent` kernels underneath get
      !! their own implicit data regions.
      integer, intent(in) :: nx
         !! i-extent (total, incl. halos).
      integer, intent(in) :: ny
         !! j-extent (total, incl. halos).
      integer, intent(in) :: nz
         !! Number of layers; `k = 1` is the bed.
      type(ocean_vcoord_t), intent(in) :: vc
         !! The vertical-coordinate slot (coord_type + every table).
      real(wp), intent(inout) :: target_h(nx, ny, nz)
         !! Target thickness at `eta = 0` (m), bottom-up.
      real(wp), intent(in) :: total_h(nx, ny)
         !! Reference column thickness (m) — `bt_H_ref` at configure,
         !! the seed's water column at IC time.
      real(wp), allocatable :: eta0(:, :)
      real(wp) :: h_nominal

      allocate (eta0(nx, ny), source=0.0_wp)
      select case (vc%coord_type)
      case (VCOORD_Z_FIXED)
         h_nominal = vc%z_fixed_h_ref/real(nz, wp)
         call ocean_vcoord_z_fixed_target(target_h, total_h, eta0, vc%z_top, &
                                          nx, ny, nz, h_nominal, &
                                          vc%z_fixed_use_profile, vc%z_fixed_zi, &
                                          vc%z_fixed_dz, vc%zstar_h_min)
      case (VCOORD_ZSTAR_FULL)
         call ocean_vcoord_geometric_target(VCOORD_ZSTAR_FULL, nx, ny, nz, target_h, &
                                            total_h, eta0, vc%dsig, vc%z_ref_global, &
                                            vc%z_ref, vc%zsigma_depth_transition, &
                                            vc%zsigma_blend_width, vc%zstar_h_min)
      case (VCOORD_ZSTAR)
         h_nominal = vc%z_fixed_h_ref/real(nz, wp)
         call ocean_vcoord_zstar_target(target_h, total_h, eta0, nx, ny, nz, h_nominal, &
                                        vc%z_fixed_use_profile, vc%z_fixed_zi, &
                                        vc%zstar_h_min)
      case default
      end select
      deallocate (eta0)
   end subroutine ocean_vcoord_eta0_target