Nodes of different colours represent the following:
Solid arrows point from a parent (sub)module to the submodule which is descended from it. Dashed arrows point from a module being used to the module or program unit using it. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | VarName | |||
integer, | intent(in) | :: | IndexType | |||
integer, | intent(in) | :: | StateType | |||
integer, | intent(in) | :: | VariableType | |||
character(len=*), | intent(in) | :: | UnitsString |
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.
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 AddToOutputVariableList(VarName,IndexType,StateType,VariableType,UnitsString)
! SUBROUTINE INFORMATION:
! AUTHOR Linda Lawrie
! DATE WRITTEN August 2010
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This routine maintains a unique list of Output Variables for the
! Variable Dictionary output.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE OutputProcessor
USE InputProcessor, ONLY: FindItemInList
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
CHARACTER(len=*), INTENT(IN) :: VarName ! Variable Name
INTEGER, INTENT(IN) :: IndexType
INTEGER, INTENT(IN) :: StateType
INTEGER, INTENT(IN) :: VariableType
CHARACTER(len=*), INTENT(IN) :: UnitsString
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
TYPE (VariableTypeForDDOutput), &
DIMENSION(:), ALLOCATABLE :: tmpDDVariableTypes ! Variable Types structure (temp for reallocate)
INTEGER :: dup ! for duplicate variable name
INTEGER :: dup2 ! for duplicate variable name
dup=0
IF (NumVariablesForOutput > 0) THEN
dup=FindItemInList(VarName,DDVariableTypes%VarNameOnly,NumVariablesForOutput)
ELSE !
ALLOCATE(DDVariableTypes(LVarAllocInc))
MaxVariablesForOutput=LVarAllocInc
ENDIF
IF (dup == 0) THEN
NumVariablesForOutput=NumVariablesForOutput+1
IF (NumVariablesForOutput > MaxVariablesForOutput) THEN
ALLOCATE(tmpDDVariableTypes(MaxVariablesForOutput))
tmpDDVariableTypes(1:MaxVariablesForOutput)=DDVariableTypes(1:MaxVariablesForOutput)
DEALLOCATE(DDVariableTypes)
ALLOCATE(DDVariableTypes(MaxVariablesForOutput+LVarAllocInc))
DDVariableTypes(1:MaxVariablesForOutput)=tmpDDVariableTypes(1:MaxVariablesForOutput)
DEALLOCATE(tmpDDVariableTypes)
MaxVariablesForOutput=MaxVariablesForOutput+LVarAllocInc
ENDIF
DDVariableTypes(NumVariablesForOutput)%IndexType=IndexType
DDVariableTypes(NumVariablesForOutput)%StoreType=StateType
DDVariableTypes(NumVariablesForOutput)%VariableType=VariableType
DDVariableTypes(NumVariablesForOutput)%VarNameOnly=VarName
DDVariableTypes(NumVariablesForOutput)%UnitsString=UnitsString
ELSEIF (UnitsString /= DDVariableTypes(dup)%UnitsString) THEN ! not the same as first units
dup2=0
DO WHILE(DDVariableTypes(dup)%Next /= 0)
IF (UnitsString /= DDVariableTypes(DDVariableTypes(dup)%Next)%UnitsString) THEN
dup=DDVariableTypes(dup)%Next
CYCLE
ENDIF
dup2=DDVariableTypes(dup)%Next
EXIT
ENDDO
IF (dup2 == 0) THEN
NumVariablesForOutput=NumVariablesForOutput+1
IF (NumVariablesForOutput > MaxVariablesForOutput) THEN
ALLOCATE(tmpDDVariableTypes(MaxVariablesForOutput))
tmpDDVariableTypes(1:MaxVariablesForOutput)=DDVariableTypes(1:MaxVariablesForOutput)
DEALLOCATE(DDVariableTypes)
ALLOCATE(DDVariableTypes(MaxVariablesForOutput+LVarAllocInc))
DDVariableTypes(1:MaxVariablesForOutput)=tmpDDVariableTypes(1:MaxVariablesForOutput)
DEALLOCATE(tmpDDVariableTypes)
MaxVariablesForOutput=MaxVariablesForOutput+LVarAllocInc
ENDIF
DDVariableTypes(NumVariablesForOutput)%IndexType=IndexType
DDVariableTypes(NumVariablesForOutput)%StoreType=StateType
DDVariableTypes(NumVariablesForOutput)%VariableType=VariableType
DDVariableTypes(NumVariablesForOutput)%VarNameOnly=VarName
DDVariableTypes(NumVariablesForOutput)%UnitsString=UnitsString
DDVariableTypes(dup)%Next=NumVariablesForOutput
ENDIF
ENDIF
RETURN
END SUBROUTINE AddToOutputVariableList