module ArrayModule implicit none private public :: & InitializeArray, & FinalizeArray type, public :: ArrayInteger_1D_Type integer, dimension(:), allocatable :: & Data end type ArrayInteger_1D_Type interface InitializeArray module procedure InitializeArrayInteger_1D end interface InitializeArray interface FinalizeArray module procedure FinalizeArrayInteger_1D end interface FinalizeArray contains subroutine InitializeArrayInteger_1D(A, nElements, LowerBoundOption) type(ArrayInteger_1D_Type), intent(inout) :: & A integer, intent(in) :: & nElements integer, intent(in), optional :: & LowerBoundOption integer :: & LowerBound LowerBound = 1 if(present(LowerBoundOption)) LowerBound = LowerBoundOption allocate(A%Data(LowerBound:LowerBound+nElements)) end subroutine InitializeArrayInteger_1D subroutine FinalizeArrayInteger_1D(A) type(ArrayInteger_1D_Type), intent(inout) :: & A deallocate(A%Data) end subroutine FinalizeArrayInteger_1D end module ArrayModule