Configure the isopycnal (DENSITY) output grid — monotone-increasing
target potential densities (kg/m³). Stored copy; must be called
BEFORE any register with output_vgrid == DIAG_VGRID_DENSITY so
the manager knows the output buffer shape (one cell per target).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ocean_diag_t), | intent(inout) | :: | this | |||
| real(kind=wp), | intent(in) | :: | rho(:) | |||
| integer, | intent(out), | optional | :: | ierr |
subroutine ocean_diag_set_output_density_levels(this, rho, ierr) !! Configure the isopycnal (DENSITY) output grid — monotone-increasing !! target potential densities (kg/m³). Stored copy; must be called !! BEFORE any `register` with `output_vgrid == DIAG_VGRID_DENSITY` so !! the manager knows the output buffer shape (one cell per target). class(ocean_diag_t), intent(inout) :: this real(wp), intent(in) :: rho(:) integer, intent(out), optional :: ierr if (present(ierr)) ierr = OCEAN_STATUS_OK if (.not. this%is_init) return if (size(rho) > NZ_STACK_MAX) then call fail("set_output_density_levels: number of density bins "// & "exceeds NZ_STACK_MAX; raise NZ_STACK_MAX or use fewer bins", & ierr, OCEAN_STATUS_ERR_SETUP) return end if if (allocated(this%rho_out)) deallocate (this%rho_out) this%n_rho_out = size(rho) allocate (this%rho_out(this%n_rho_out), source=rho) end subroutine ocean_diag_set_output_density_levels