ocean_vcoord_set_z_fixed_profile Subroutine

public pure subroutine ocean_vcoord_set_z_fixed_profile(this, dz_surface_first)

Install a stretched VCOORD_Z_FIXED nominal profile: flip the surface-first thicknesses into the bottom-up z_fixed_dz, build the interface table z_fixed_zi by accumulating from the surface (z_fixed_zi(nz) = 0 exactly), set z_fixed_h_ref to the total and raise z_fixed_use_profile. Setup-time host code; must run BEFORE enter_data (the copyin captures the tables).

Arguments

Type IntentOptional Attributes Name
type(ocean_vcoord_t), intent(inout) :: this
real(kind=wp), intent(in) :: dz_surface_first(:)

Nominal thicknesses (m), dz_surface_first(1) = top layer; size must be nz_ml.


Called by

proc~~ocean_vcoord_set_z_fixed_profile~~CalledByGraph proc~ocean_vcoord_set_z_fixed_profile ocean_vcoord_set_z_fixed_profile proc~configure_ocean_z_fixed_profile configure_ocean_z_fixed_profile proc~configure_ocean_z_fixed_profile->proc~ocean_vcoord_set_z_fixed_profile proc~configure_ocean_lateral configure_ocean_lateral proc~configure_ocean_lateral->proc~configure_ocean_z_fixed_profile proc~engine_setup engine_setup proc~engine_setup->proc~configure_ocean_z_fixed_profile proc~engine_setup->proc~configure_ocean_lateral 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
integer, private :: k
integer, private :: nz

Source Code

   pure subroutine ocean_vcoord_set_z_fixed_profile(this, dz_surface_first)
      !! Install a stretched `VCOORD_Z_FIXED` nominal profile: flip the
      !! surface-first thicknesses into the bottom-up `z_fixed_dz`, build
      !! the interface table `z_fixed_zi` by accumulating from the surface
      !! (`z_fixed_zi(nz) = 0` exactly), set `z_fixed_h_ref` to the total
      !! and raise `z_fixed_use_profile`.  Setup-time host code; must run
      !! BEFORE `enter_data` (the copyin captures the tables).
      type(ocean_vcoord_t), intent(inout) :: this
      real(wp), intent(in) :: dz_surface_first(:)
         !! Nominal thicknesses (m), `dz_surface_first(1)` = top layer;
         !! size must be `nz_ml`.
      integer :: k, nz
      if (.not. this%is_init) return
      nz = this%nz_ml
      if (size(dz_surface_first) /= nz) return
      do k = 1, nz
         this%z_fixed_dz(k) = dz_surface_first(nz - k + 1)
      end do
      this%z_fixed_zi(nz) = 0.0_wp
      do k = nz, 1, -1
         this%z_fixed_zi(k - 1) = this%z_fixed_zi(k) + this%z_fixed_dz(k)
      end do
      this%z_fixed_h_ref = this%z_fixed_zi(0)
      this%z_fixed_use_profile = .true.
   end subroutine ocean_vcoord_set_z_fixed_profile