The main documentation of the Finalize_ELL_Matrix Procedure contains additional explanation of this code listing.
subroutine Finalize_ELL_Matrix (ELLM, status) ! Use association information. use Caesar_Flags_Module, only: uninitialized_flag use Caesar_Numbers_Module, only: zero ! Input/Output variable. ! ELL_Matrix to be finalized. type(ELL_Matrix_type), intent(inout) :: ELLM ! Output variables. type(Status_type), intent(out), optional :: status ! Exit status. ! Internal variables. ! Deallocation Status. type(Status_type), dimension(22) :: deallocate_status type(Status_type) :: consolidated_status ! Consolidated Status. !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ! Verify requirements. VERIFY(Valid_State(ELLM),7) ! ELL_Matrix is valid. ! Unset initialization flag. ELLM%Initialized = uninitialized_flag ! Deallocations and finalizations. ! Set deallocation status. call Initialize (deallocate_status) call Initialize (consolidated_status) ! Finalize internals. NULLIFY(ELLM%Row_Structure) NULLIFY(ELLM%Column_Structure) call Finalize (ELLM%Average, deallocate_status( 1)) call Finalize (ELLM%Average_is_Updated, deallocate_status( 2)) call Finalize (ELLM%Columns, deallocate_status( 3)) call Finalize (ELLM%Frobenius_Norm, deallocate_status( 4)) call Finalize (ELLM%Frobenius_Norm_is_Updated, deallocate_status( 5)) call Finalize (ELLM%Index, deallocate_status( 6)) call Finalize (ELLM%Index_is_Updated, deallocate_status( 7)) call Finalize (ELLM%Infinity_Norm, deallocate_status( 8)) call Finalize (ELLM%Infinity_Norm_is_Updated, deallocate_status( 9)) call Finalize (ELLM%Max_Nonzeros, deallocate_status(10)) call Finalize (ELLM%Maximum, deallocate_status(11)) call Finalize (ELLM%Maximum_is_Updated, deallocate_status(12)) call Finalize (ELLM%Minimum, deallocate_status(13)) call Finalize (ELLM%Minimum_is_Updated, deallocate_status(14)) call Finalize (ELLM%Name, deallocate_status(15)) call Finalize (ELLM%One_Norm, deallocate_status(16)) call Finalize (ELLM%One_Norm_is_Updated, deallocate_status(17)) call Finalize (ELLM%Sum, deallocate_status(18)) call Finalize (ELLM%Sum_is_Updated, deallocate_status(19)) call Finalize (ELLM%Two_Norm_Estimate, deallocate_status(20)) call Finalize (ELLM%Two_Norm_is_Updated, deallocate_status(21)) call Finalize (ELLM%Values, deallocate_status(22)) ELLM%Two_Norm_Range = (/ zero, zero /) ! 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(ELLM),7) ! ELL_Matrix is not valid. return end subroutine Finalize_ELL_Matrix