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) | :: | KeyValue | |||
character(len=*), | intent(in) | :: | VariableName |
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 AddRecordToOutputVariableStructure(KeyValue,VariableName)
! SUBROUTINE INFORMATION:
! AUTHOR Linda Lawrie
! DATE WRITTEN July 2010
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This routine adds a new record (if necessary) to the Output Variable
! reporting structure. DataOutputs, OutputVariablesForSimulation
! METHODOLOGY EMPLOYED:
! OutputVariablesForSimulation is a linked list structure for later
! semi-easy perusal.
! REFERENCES:
! na
! USE STATEMENTS:
USE DataOutputs
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
CHARACTER(len=*), INTENT(IN) :: KeyValue
CHARACTER(len=*), INTENT(IN) :: VariableName
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: CurNum
INTEGER :: NextNum
LOGICAL :: FoundOne
INTEGER :: vnameLen ! if < length, there were units on the line/name
vnameLen=INDEX(VariableName,'[')
IF (vnameLen == 0) THEN
vnameLen=LEN_TRIM(VariableName)
ELSE
vnameLen=vnameLen-1
vnameLen=LEN_TRIM(VariableName(1:vnameLen))
ENDIF
FoundOne=.false.
DO CurNum=1,NumConsideredOutputVariables
IF (VariableName(1:vnameLen) == OutputVariablesForSimulation(CurNum)%VarName) THEN
FoundOne=.true.
EXIT
ENDIF
ENDDO
IF (.not. FoundOne) THEN
IF (NumConsideredOutputVariables == MaxConsideredOutputVariables) THEN
CALL ReAllocateAndPreserveOutputVariablesForSimulation
ENDIF
NumConsideredOutputVariables=NumConsideredOutputVariables+1
OutputVariablesForSimulation(NumConsideredOutputVariables)%Key=KeyValue
OutputVariablesForSimulation(NumConsideredOutputVariables)%VarName=VariableName(1:vnameLen)
OutputVariablesForSimulation(NumConsideredOutputVariables)%Previous=0
OutputVariablesForSimulation(NumConsideredOutputVariables)%Next=0
ELSE
IF (KeyValue /= OutputVariablesForSimulation(CurNum)%Key) THEN
NextNum=CurNum
IF (OutputVariablesForSimulation(NextNum)%Next /= 0) THEN
DO WHILE (OutputVariablesForSimulation(NextNum)%Next /= 0)
CurNum=NextNum
NextNum=OutputVariablesForSimulation(NextNum)%Next
ENDDO
IF (NumConsideredOutputVariables == MaxConsideredOutputVariables) THEN
CALL ReAllocateAndPreserveOutputVariablesForSimulation
ENDIF
NumConsideredOutputVariables=NumConsideredOutputVariables+1
OutputVariablesForSimulation(NumConsideredOutputVariables)%Key=KeyValue
OutputVariablesForSimulation(NumConsideredOutputVariables)%VarName=VariableName(1:vnameLen)
OutputVariablesForSimulation(NumConsideredOutputVariables)%Previous=NextNum
OutputVariablesForSimulation(NextNum)%Next=NumConsideredOutputVariables
ELSE
IF (NumConsideredOutputVariables == MaxConsideredOutputVariables) THEN
CALL ReAllocateAndPreserveOutputVariablesForSimulation
ENDIF
NumConsideredOutputVariables=NumConsideredOutputVariables+1
OutputVariablesForSimulation(NumConsideredOutputVariables)%Key=KeyValue
OutputVariablesForSimulation(NumConsideredOutputVariables)%VarName=VariableName(1:vnameLen)
OutputVariablesForSimulation(NumConsideredOutputVariables)%Previous=CurNum
OutputVariablesForSimulation(CurNum)%Next=NumConsideredOutputVariables
ENDIF
ENDIF
ENDIF
RETURN
END SUBROUTINE AddRecordToOutputVariableStructure