The main documentation of the Finalize_Overlapped_Vector Procedure contains additional explanation of this code listing.
subroutine Finalize_Overlapped_Vector (OV, status) ! Use associations. use Caesar_Flags_Module, only: uninitialized_flag ! Input/Output variable. ! Overlapped_Vector to be finalized. type(Overlapped_Vector_type), intent(inout) :: OV ! Output variable. type(Status_type), intent(out), optional :: status ! Exit status. ! Internal variables. type(Status_type), dimension(5) :: deallocate_status ! Deallocation Status. type(Status_type) :: consolidated_status ! Consolidated Status. !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ! Verify requirements. VERIFY(Valid_State(OV),7) ! OV is valid. ! Unset initialization flag. OV%Initialized = uninitialized_flag ! Set deallocation status. call Initialize (deallocate_status) call Initialize (consolidated_status) ! Finalize internals. NULLIFY(OV%One_Structure) NULLIFY(OV%Many_Structure) NULLIFY(OV%Dimensions) NULLIFY(OV%DV) NULLIFY(OV%Many_of_One_Index) NULLIFY(OV%Overlap_Index) NULLIFY(OV%Overlap_Trace) select case (OV%Dimensionality) case (1) call Finalize (OV%Overlap_Values1, deallocate_status(1)) case (2) call Finalize (OV%Overlap_Values2, deallocate_status(1)) case (3) call Finalize (OV%Overlap_Values3, deallocate_status(1)) case (4) call Finalize (OV%Overlap_Values4, deallocate_status(1)) !case (-1) ! call Finalize (OV%Overlap_ValuesRR, deallocate_status(1)) end select call Finalize (OV%Dimensionality, deallocate_status(2)) call Finalize (OV%Name, deallocate_status(3)) call Finalize (OV%Version, deallocate_status(4)) if (Initialized(OV%DV_Internal)) then call Finalize (OV%DV_Internal, deallocate_status(5)) end if ! Process status variables. consolidated_status = deallocate_status if (PRESENT(status)) then WARN_IF(Error(consolidated_status), 5) status = consolidated_status else VERIFY(Normal(consolidated_status), 5) end if call Finalize (consolidated_status) call Finalize (deallocate_status) ! Verify guarantees. VERIFY(.not.Valid_State(OV),7) ! OV is not valid. return end subroutine Finalize_Overlapped_Vector