| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ocean_diag_t), | intent(inout) | :: | this |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | i |
subroutine ocean_diag_destroy(this) class(ocean_diag_t), intent(inout) :: this integer :: i this%is_init = .false. if (allocated(this%vars)) then do i = 1, this%nvars if (allocated(this%vars(i)%output_buffer)) deallocate (this%vars(i)%output_buffer) if (allocated(this%vars(i)%layer_buffer)) deallocate (this%vars(i)%layer_buffer) if (allocated(this%vars(i)%accumulator)) deallocate (this%vars(i)%accumulator) if (allocated(this%vars(i)%mask)) then call diag_mask_destroy(this%vars(i)%mask) deallocate (this%vars(i)%mask) end if nullify (this%vars(i)%fill) nullify (this%vars(i)%remap) end do deallocate (this%vars) end if this%nvars = 0 this%nvars_max = 0 if (allocated(this%z_out)) deallocate (this%z_out) if (allocated(this%rho_out)) deallocate (this%rho_out) if (allocated(this%sigma_out)) deallocate (this%sigma_out) if (allocated(this%zstar_out)) deallocate (this%zstar_out) if (allocated(this%send_buf)) deallocate (this%send_buf) ! Host-only fp32 staging buffer for the single-precision diag stream ! (never device-mapped, so no exit_data pairing). Normally released ! by `close_stream`; freed here too so a destroy without a close ! does not leak. if (allocated(this%nc_stream%stage)) deallocate (this%nc_stream%stage) end subroutine ocean_diag_destroy