Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(inout), | ALLOCATABLE, DIMENSION(:) | :: | Array | ||
integer, | intent(inout) | :: | ArrayMax | |||
integer, | intent(in) | :: | ArrayInc |
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
SUBROUTINE ReallocateIntegerArray(Array,ArrayMax,ArrayInc)
! SUBROUTINE INFORMATION:
! AUTHOR Linda K. Lawrie
! DATE WRITTEN March 2008
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine reallocates (preserving data) an Integer array
! for the output processor.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
! na
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, ALLOCATABLE, DIMENSION(:), INTENT(INOUT) :: Array
INTEGER, INTENT(INOUT) :: ArrayMax ! Current and resultant dimension for Array
INTEGER, INTENT(IN) :: ArrayInc ! increment for redimension
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER, DIMENSION(:), ALLOCATABLE :: NewArray
ALLOCATE(NewArray(ArrayMax+ArrayInc))
NewArray=0
IF (ArrayMax > 0) THEN
NewArray(1:ArrayMax)=Array(1:ArrayMax)
ENDIF
DEALLOCATE(Array)
ArrayMax=ArrayMax+ArrayInc
ALLOCATE(Array(ArrayMax))
Array=NewArray
DEALLOCATE(NewArray)
RETURN
END SUBROUTINE ReallocateIntegerArray