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 | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(ocean_vcoord_t), | intent(inout) | :: | this | |||
| real(kind=wp), | intent(in) | :: | dz_surface_first(:) |
Nominal thicknesses (m), |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | k | ||||
| integer, | private | :: | nz |
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