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) | :: | reportID | |||
character(len=*), | intent(in) | :: | creportID | |||
integer, | intent(in) | :: | timeIndex | |||
real(kind=r64), | intent(in) | :: | repValue | |||
integer, | intent(in) | :: | reportingInterval | |||
real(kind=r64), | intent(in) | :: | minValue | |||
integer, | intent(in) | :: | minValueDate | |||
real(kind=r64), | intent(in) | :: | maxValue | |||
integer, | intent(in) | :: | maxValueDate | |||
logical, | intent(in) | :: | meterOnlyFlag |
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 WriteReportMeterData (reportID, creportID, timeIndex, repValue, reportingInterval, &
minValue, minValueDate, maxValue, maxValueDate, meterOnlyFlag)
! SUBROUTINE INFORMATION:
! AUTHOR Greg Stark
! DATE WRITTEN July 2008
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine writes for the non-cumulative meter data to the output files and
! SQL database.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE DataPrecisionGlobals
USE DataGlobals, ONLY: OutputFileStandard, OutputFileMeters, StdOutputRecordCount, StdMeterRecordCount
USE General, ONLY: RemoveTrailingZeros
USE SQLiteProcedures
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: reportID ! The variable's report ID
CHARACTER(len=*), INTENT(IN) :: creportID ! variable ID in characters
INTEGER, INTENT(IN) :: timeIndex ! An index that points to the timestamp
REAL(r64), INTENT(IN) :: repValue ! The variable's value
INTEGER, INTENT(IN) :: reportingInterval ! The variable's reporting interval (e.g., hourly)
REAL(r64), INTENT(IN) :: maxValue ! The variable's maximum value during the reporting interval
INTEGER, INTENT(IN) :: maxValueDate ! The date of the maximum value
REAL(r64), INTENT(IN) :: minValue ! The variable's minimum value during the reporting interval
INTEGER, INTENT(IN) :: minValueDate ! The date the minimum value occurred
LOGICAL, INTENT(IN) :: meterOnlyFlag ! Indicates whether the data is for the meter file only
! SUBROUTINE PARAMETER DEFINITIONS:
CHARACTER(len=*), PARAMETER :: fmta="(A)"
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
CHARACTER(len=32) :: NumberOut ! Character for producing "number out"
CHARACTER(len=55) :: MaxOut ! Character for Max out string
CHARACTER(len=55) :: MinOut ! Character for Min out string
IF (repValue == 0.0d0) THEN
NumberOut = '0.0'
ELSE
WRITE(NumberOut,*) repValue
NumberOut = ADJUSTL(NumberOut)
NumberOut = RemoveTrailingZeros(NumberOut)
ENDIF
IF (maxValue == 0.0d0) THEN
MaxOut = '0.0'
ELSE
WRITE(MaxOut,*) maxValue
MaxOut = ADJUSTL(MaxOut)
MaxOut = RemoveTrailingZeros(MaxOut)
ENDIF
IF (minValue == 0.0d0) THEN
MinOut = '0.0'
ELSE
WRITE(MinOut,*) minValue
MinOut = ADJUSTL(MinOut)
MinOut = RemoveTrailingZeros(MinOut)
ENDIF
IF (WriteOutputToSQLite) THEN
CALL CreateSQLiteMeterRecord(reportID, TimeIndex, repValue, reportingInterval, &
minValue, minValueDate, maxValue, maxValueDate, MinutesPerTimeStep)
END IF
! Append the min and max strings with date information
! CALL ProduceMinMaxStringWStartMinute (MinOut, minValueDate, reportingInterval)
! CALL ProduceMinMaxStringWStartMinute (MaxOut, maxValueDate, reportingInterval)
CALL ProduceMinMaxString (MinOut, minValueDate, reportingInterval)
CALL ProduceMinMaxString (MaxOut, maxValueDate, reportingInterval)
SELECT CASE (reportingInterval)
CASE (ReportEach, ReportTimeStep, ReportHourly) ! -1, 0, 1
WRITE(OutputFileMeters, fmta) TRIM(creportID)//','//TRIM(NumberOut)
StdMeterRecordCount = StdMeterRecordCount + 1
CASE (ReportDaily, ReportMonthly, ReportSim) ! 2, 3, 4
WRITE(OutputFileMeters, fmta) TRIM(creportID)//','//TRIM(NumberOut)//','//TRIM(MinOut)//','//TRIM(MaxOut)
StdMeterRecordCount = StdMeterRecordCount + 1
END SELECT
IF (.not. meterOnlyFlag) THEN
IF (WriteOutputToSQLite) THEN
CALL CreateSQLiteReportVariableDataRecord(reportID, TimeIndex, repValue, reportingInterval, &
minValue, minValueDate, maxValue, maxValueDate, MinutesPerTimeStep)
END IF
SELECT CASE (reportingInterval)
CASE (ReportEach, ReportTimeStep, ReportHourly) ! -1, 0, 1
WRITE(OutputFileStandard, fmta) TRIM(creportID)//','//TRIM(NumberOut)
StdOutputRecordCount = StdOutputRecordCount + 1
CASE (ReportDaily, ReportMonthly, ReportSim) ! 2, 3, 4
WRITE(OutputFileStandard, fmta) TRIM(creportID)//','//TRIM(NumberOut)//','//TRIM(MinOut)//','//TRIM(MaxOut)
StdOutputRecordCount = StdOutputRecordCount + 1
END SELECT
END IF
RETURN
END SUBROUTINE WriteReportMeterData