ocean_budgets_destroy Subroutine

private subroutine ocean_budgets_destroy(this)

Type Bound

ocean_budgets_t

Arguments

Type IntentOptional Attributes Name
class(ocean_budgets_t), intent(inout) :: this

Calls

proc~~ocean_budgets_destroy~~CallsGraph proc~ocean_budgets_destroy ocean_budgets_t%ocean_budgets_destroy proc~diag_mask_destroy diag_mask_destroy proc~ocean_budgets_destroy->proc~diag_mask_destroy

Variables

Type Visibility Attributes Name Initial
integer, private :: i

Source Code

   subroutine ocean_budgets_destroy(this)
      class(ocean_budgets_t), intent(inout) :: this
      integer :: i
      this%is_init = .false.
      this%nbudgets = 0
      this%values = 0.0_wp
      this%values_init = 0.0_wp
      this%has_snapshot = .false.
      if (allocated(this%areaT)) deallocate (this%areaT)
      if (allocated(this%mask)) then
         call diag_mask_destroy(this%mask)
         deallocate (this%mask)
      end if
      if (allocated(this%contributors)) then
         do i = 1, this%n_contributors
            nullify (this%contributors(i)%per_cell)
         end do
         deallocate (this%contributors)
      end if
      this%n_contributors = 0
      this%n_contributors_max = 0
   end subroutine ocean_budgets_destroy