Configure the fixed-z output grid. Stored copy; the original
z array is not retained. Must be called BEFORE any
register with output_vgrid == DIAG_VGRID_Z_FIXED so the
manager knows the output buffer shape.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ocean_diag_t), | intent(inout) | :: | this | |||
| real(kind=wp), | intent(in) | :: | z(:) | |||
| integer, | intent(out), | optional | :: | ierr |
Non-zero ( |
subroutine ocean_diag_set_output_z_levels(this, z, ierr) !! Configure the fixed-z output grid. Stored copy; the original !! `z` array is not retained. Must be called BEFORE any !! `register` with `output_vgrid == DIAG_VGRID_Z_FIXED` so the !! manager knows the output buffer shape. class(ocean_diag_t), intent(inout) :: this real(wp), intent(in) :: z(:) integer, intent(out), optional :: ierr !! Non-zero (`OCEAN_STATUS_ERR_SETUP`) when `size(z) > !! NZ_STACK_MAX`, when present; absent behaves as today !! (`error stop`). (F5 residual, P2.4) if (present(ierr)) ierr = OCEAN_STATUS_OK if (.not. this%is_init) return ! The conservative remap pads to max(nz, nz_out) in NZ_STACK_MAX-sized ! per-column stack buffers; more output levels than that would overrun ! them (silent device illegal-address). Fail loud instead. if (size(z) > NZ_STACK_MAX) then call fail("set_output_z_levels: number of z-levels exceeds "// & "NZ_STACK_MAX; raise NZ_STACK_MAX or use fewer levels", & ierr, OCEAN_STATUS_ERR_SETUP) return end if if (allocated(this%z_out)) deallocate (this%z_out) this%nz_out = size(z) allocate (this%z_out(this%nz_out), source=z) end subroutine ocean_diag_set_output_z_levels