Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | varMe | |||
integer, | intent(in) | :: | varOperand |
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 addOperand(varMe,varOperand)
! SUBROUTINE INFORMATION:
! AUTHOR Jason Glazer of GARD Analytics, Inc.
! DATE WRITTEN July 2004
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Used by CreateDefaultComputation to create the dependancy
! relationship in the EconVar array
! METHODOLOGY EMPLOYED:
! REFERENCES:
! na
! USE STATEMENTS:
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER,INTENT(IN) :: varMe
INTEGER,INTENT(IN) :: varOperand
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: sizeIncrement = 100
INTEGER, SAVE :: prevVarMe = 0
IF (varOperand .NE. 0) THEN
!increment the numOperand and allocate/reallocate the array
!if necessary
IF (.NOT. ALLOCATED(operand)) THEN
ALLOCATE(operand(sizeIncrement))
sizeOperand = sizeIncrement
numOperand = 1
ELSE
numOperand = numOperand + 1
! if larger then current size then make a temporary array of the same
! type and put stuff into it while reallocating the main array
IF (numOperand .GT. sizeOperand) THEN
ALLOCATE(operandCopy(sizeOperand))
operandCopy = operand
DEALLOCATE(operand)
ALLOCATE(operand(sizeOperand + sizeIncrement))
operand(1:sizeOperand) = operandCopy
DEALLOCATE(operandCopy)
sizeOperand = sizeOperand + sizeIncrement
END IF
END IF
!now add the dependancy relationship
operand(numOperand) = varOperand
econVar(varMe)%lastOperand = numOperand
!if it is the first time addOperand was called with the varMe value
!then set the first pointer as well
IF (varMe .NE. prevVarMe) THEN
econVar(varMe)%firstOperand = numOperand
prevVarMe = varMe
END IF
END IF
END SUBROUTINE addOperand