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 | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | reportingInterval | |||
integer, | intent(in) | :: | storeType | |||
integer, | intent(in) | :: | reportID | |||
integer, | intent(in) | :: | indexGroupKey | |||
character(len=*), | intent(in) | :: | indexGroup | |||
character(len=*), | intent(in) | :: | reportIDChr | |||
character(len=*), | intent(in) | :: | meterName | |||
character(len=*), | intent(in) | :: | unitsString | |||
logical, | intent(in) | :: | cumulativeMeterFlag | |||
logical, | intent(in) | :: | meterFileOnlyFlag |
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 WriteMeterDictionaryItem (reportingInterval, storeType, reportID, indexGroupKey, &
indexGroup, reportIDChr, meterName, unitsString, cumulativeMeterFlag, meterFileOnlyFlag)
! SUBROUTINE INFORMATION:
! AUTHOR Greg Stark
! DATE WRITTEN August 2008
! MODIFIED April 2011; Linda Lawrie
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! The subroutine writes meter data dictionary information to the output files
! and the SQL database. Much of the code here was embedded in other subroutines
! and was moved here for the purposes of ease of maintenance and to allow easy
! data reporting to the SQL database
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE DataGlobals, ONLY: OutputFileMeters, OutputFileStandard
USE SQLiteProcedures
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: reportingInterval ! The reporting interval (e.g., hourly, daily)
INTEGER, INTENT(IN) :: storeType
INTEGER, INTENT(IN) :: reportID ! The reporting ID in for the variable
INTEGER, INTENT(IN) :: indexGroupKey ! The reporting group for the variable
CHARACTER(len=*), INTENT(IN) :: indexGroup ! The reporting group for the variable
CHARACTER(len=*), INTENT(IN) :: reportIDChr ! The reporting ID in for the variable
CHARACTER(len=*), INTENT(IN) :: meterName ! The variable's meter name
CHARACTER(len=*), INTENT(IN) :: unitsString ! The variables units
LOGICAL, INTENT(IN) :: cumulativeMeterFlag ! A flag indicating cumulative data
LOGICAL, INTENT(IN) :: meterFileOnlyFlag ! A flag indicating whether the data is to be written to standard output
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
CHARACTER(len=120) :: FreqString
CHARACTER(len=20) :: keyedValueString = 'Cumulative '
INTEGER :: lenString
FreqString = FreqNotice (reportingInterval, storeType)
SELECT CASE (reportingInterval)
CASE (ReportEach, ReportTimeStep, ReportHourly) ! -1, 0, 1
IF (.not. cumulativeMeterFlag) THEN
WRITE(OutputFileMeters, fmta) TRIM(reportIDChr)//',1,'//TRIM(meterName)// &
' ['//TRIM(unitsString)//']'//TRIM(FreqString)
ELSE
WRITE(OutputFileMeters, fmta) TRIM(reportIDChr)//',1,Cumulative '//TRIM(meterName)// &
' ['//TRIM(unitsString)//']'//TRIM(FreqString)
ENDIF
IF (.not. meterFileOnlyFlag) THEN
IF (.not. cumulativeMeterFlag) THEN
WRITE(OutputFileStandard, fmta) TRIM(reportIDChr)//',1,'//TRIM(meterName)// &
' ['//TRIM(unitsString)//']'//TRIM(FreqString)
ELSE
WRITE(OutputFileStandard, fmta) TRIM(reportIDChr)//',1,Cumulative '//TRIM(meterName)// &
' ['//TRIM(unitsString)//']'//TRIM(FreqString)
ENDIF
END IF
CASE (ReportDaily) ! 2
IF (.not. cumulativeMeterFlag) THEN
WRITE(OutputFileMeters, fmta) TRIM(reportIDChr)//',7,'//TRIM(meterName)// &
' ['//TRIM(unitsString)//']'//TRIM(FreqString)
ELSE
lenString=INDEX(FreqString,'[')
WRITE(OutputFileMeters, fmta) TRIM(reportIDChr)//',1,Cumulative '//TRIM(meterName)// &
' ['//TRIM(unitsString)//']'//TRIM(FreqString(1:lenString-1))
ENDIF
IF (.not. meterFileOnlyFlag) THEN
IF (.not. cumulativeMeterFlag) THEN
WRITE(OutputFileStandard, fmta) TRIM(reportIDChr)//',7,'//TRIM(meterName)// &
' ['//TRIM(unitsString)//']'//TRIM(FreqString)
ELSE
lenString=INDEX(FreqString,'[')
WRITE(OutputFileStandard, fmta) TRIM(reportIDChr)//',1,Cumulative '//TRIM(meterName)// &
' ['//TRIM(unitsString)//']'//TRIM(FreqString(1:lenString-1))
ENDIF
ENDIF
CASE (ReportMonthly) ! 3
IF (.not. cumulativeMeterFlag) THEN
WRITE(OutputFileMeters, fmta) TRIM(reportIDChr)//',9,'//TRIM(meterName)// &
' ['//TRIM(unitsString)//']'//TRIM(FreqString)
ELSE
lenString=INDEX(FreqString,'[')
WRITE(OutputFileMeters, fmta) TRIM(reportIDChr)//',1,Cumulative '//TRIM(meterName)// &
' ['//TRIM(unitsString)//']'//TRIM(FreqString(1:lenString-1))
ENDIF
IF (.not. meterFileOnlyFlag) THEN
IF (.not. cumulativeMeterFlag) THEN
WRITE(OutputFileStandard, fmta) TRIM(reportIDChr)//',9,'//TRIM(meterName)// &
' ['//TRIM(unitsString)//']'//TRIM(FreqString)
ELSE
lenString=INDEX(FreqString,'[')
WRITE(OutputFileStandard, fmta) TRIM(reportIDChr)//',1,Cumulative '//TRIM(meterName)// &
' ['//TRIM(unitsString)//']'//TRIM(FreqString(1:lenString-1))
ENDIF
ENDIF
CASE (ReportSim) ! 4
IF (.not. cumulativeMeterFlag) THEN
WRITE(OutputFileMeters, fmta) TRIM(reportIDChr)//',11,'//TRIM(meterName)// &
' ['//TRIM(unitsString)//']'//TRIM(FreqString)
ELSE
lenString=INDEX(FreqString,'[')
WRITE(OutputFileMeters, fmta) TRIM(reportIDChr)//',1,Cumulative '//TRIM(meterName)// &
' ['//TRIM(unitsString)//']'//TRIM(FreqString(1:lenString-1))
ENDIF
IF (.not. meterFileOnlyFlag) THEN
IF (.not. cumulativeMeterFlag) THEN
WRITE(OutputFileStandard, fmta) TRIM(reportIDChr)//',11,'//TRIM(meterName)// &
' ['//TRIM(unitsString)//']'//TRIM(FreqString)
ELSE
lenString=INDEX(FreqString,'[')
WRITE(OutputFileStandard, fmta) TRIM(reportIDChr)//',1,Cumulative '//TRIM(meterName)// &
' ['//TRIM(unitsString)//']'//TRIM(FreqString(1:lenString-1))
ENDIF
ENDIF
END SELECT
IF (WriteOutputToSQLite) THEN
IF (cumulativeMeterFlag) THEN
keyedValueString = 'Cumulative '
ELSE
keyedValueString = ''
END IF
CALL CreateSQLiteMeterDictionaryRecord (reportID, storeType, &
indexGroup, keyedValueString, meterName, 1, unitsString, reportingInterval)
IF (.not. meterFileOnlyFlag) THEN
CALL CreateSQLiteReportVariableDictionaryRecord (reportID, storeType, indexGroup, &
keyedValueString, meterName, 1, unitsString, reportingInterval)
END IF
END IF
RETURN
END SUBROUTINE WriteMeterDictionaryItem