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) | :: | titleString | |||
logical, | intent(in) | :: | includeCategory | |||
logical, | intent(in) | :: | showCurrencySymbol | |||
character(len=*), | intent(in) | :: | forString |
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 ReportEconomicVariable(titleString,includeCategory,showCurrencySymbol,forString)
! SUBROUTINE INFORMATION:
! AUTHOR Jason Glazer of GARD Analytics, Inc.
! DATE WRITTEN July 2004
! MODIFIED January 2010, Kyle Benne
! Added sqlite output
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Report all econVar that show as activeNow
! METHODOLOGY EMPLOYED:
! REFERENCES:
! na
! USE STATEMENTS:
USE OutputReportTabular, ONLY: WriteReportHeaders, WriteSubtitle, WriteTable, RealToStr
USE SQLiteProcedures, ONLY: CreateSQLiteTabularDataRecords
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
CHARACTER(len=*), INTENT(IN) :: titleString
LOGICAL, INTENT(IN) :: includeCategory
LOGICAL, INTENT(IN) :: showCurrencySymbol
CHARACTER(len=*), INTENT(IN) :: forString
! The majority of the input is the econVar array
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
! all arrays are in the format: (row, column)
CHARACTER(len=MaxNameLength),ALLOCATABLE, DIMENSION(:) :: columnHead
INTEGER,ALLOCATABLE,DIMENSION(:) :: columnWidth
CHARACTER(len=MaxNameLength),ALLOCATABLE, DIMENSION(:) :: rowHead
CHARACTER(len=MaxNameLength),ALLOCATABLE, DIMENSION(:,:) :: tableBody
REAL(r64) :: sumVal
REAL(r64) :: maximumVal
REAL(r64) :: curVal
INTEGER :: curIndex
INTEGER :: curCatPt
INTEGER :: curCategory
INTEGER :: iVar
INTEGER :: jMonth
INTEGER :: cntOfVar
INTEGER :: nCntOfVar
cntOfVar = 0
DO iVar = 1, numEconVar
IF (econVar(iVar)%activeNow) THEN
cntOfVar = cntOfVar + 1
END IF
END DO
IF (includeCategory) THEN
ALLOCATE(rowHead(cntOfVar))
ALLOCATE(columnHead(15))
ALLOCATE(columnWidth(15))
ALLOCATE(tableBody(cntOfVar,15))
ELSE
ALLOCATE(rowHead(cntOfVar))
ALLOCATE(columnHead(14))
ALLOCATE(columnWidth(14))
ALLOCATE(tableBody(cntOfVar,14))
END IF
! column names
columnHead(1) = 'Jan'
columnHead(2) = 'Feb'
columnHead(3) = 'Mar'
columnHead(4) = 'Apr'
columnHead(5) = 'May'
columnHead(6) = 'Jun'
columnHead(7) = 'Jul'
columnHead(8) = 'Aug'
columnHead(9) = 'Sep'
columnHead(10) = 'Oct'
columnHead(11) = 'Nov'
columnHead(12) = 'Dec'
columnHead(13) = 'Sum'
columnHead(14) = 'Max'
IF (includeCategory) THEN
columnHead(15) = 'Category'
END IF
nCntOfVar = 0
!row names
DO iVar = 1,numEconVar
IF (econVar(iVar)%activeNow) THEN
nCntOfVar = nCntOfVar + 1
IF (showCurrencySymbol) THEN
rowHead(nCntOfVar) = TRIM(econVar(iVar)%name) // ' (~~$~~)'
ELSE
rowHead(nCntOfVar) = TRIM(econVar(iVar)%name)
END IF
END IF
END DO
! fill the body
nCntOfVar = 0
DO iVar = 1,numEconVar
IF (econVar(iVar)%activeNow) THEN
nCntOfVar = nCntOfVar + 1
DO jMonth = 1,12 !note not all months get printed out if more than 12 are used.- need to fix this later
curVal = econVar(iVar)%values(jMonth)
IF ((curVal .GT. 0) .AND. (curVal .LT. 1)) THEN
tableBody(nCntOfVar,jMonth) = TRIM(RealToStr(curVal,4))
ELSE
tableBody(nCntOfVar,jMonth) = TRIM(RealToStr(curVal,2))
END IF
END DO
CALL getMaxAndSum(iVar,sumVal,maximumVal)
tableBody(nCntOfVar,13) = TRIM(RealToStr(sumVal,2))
tableBody(nCntOfVar,14) = TRIM(RealToStr(maximumVal,2))
IF (includeCategory) THEN
!first find category
curCategory = 0
curIndex = econVar(iVar)%index
SELECT CASE (econVar(iVar)%kindOfObj)
CASE (kindChargeSimple)
IF ((curIndex .GE. 1) .AND. (curIndex .LE. numChargeSimple)) THEN
curCatPt = chargeSimple(curIndex)%categoryPt
END IF
CASE (kindChargeBlock)
IF ((curIndex .GE. 1) .AND. (curIndex .LE. numChargeBlock)) THEN
curCatPt = chargeBlock(curIndex)%categoryPt
END IF
END SELECT
IF ((curCatPt .GE. 1) .AND. (curCatPt .LE. numEconVar)) THEN
curCategory = econVar(curCatPt)%specific
ENDIF
SELECT CASE (curCategory)
CASE (catEnergyCharges)
tableBody(nCntOfVar,15) = 'EnergyCharges'
CASE (catDemandCharges)
tableBody(nCntOfVar,15) = 'DemandCharges'
CASE (catServiceCharges)
tableBody(nCntOfVar,15) = 'ServiceCharges'
CASE (catBasis)
tableBody(nCntOfVar,15) = 'Basis'
CASE (catAdjustment)
tableBody(nCntOfVar,15) = 'Adjustment'
CASE (catSurcharge)
tableBody(nCntOfVar,15) = 'Surcharge'
CASE (catSubtotal)
tableBody(nCntOfVar,15) = 'Subtotal'
CASE (catTaxes)
tableBody(nCntOfVar,15) = 'Taxes'
CASE (catTotal)
tableBody(nCntOfVar,15) = 'Total'
CASE DEFAULT
tableBody(nCntOfVar,15) = 'none'
END SELECT
END IF
econVar(iVar)%isReported = .TRUE.
END IF
END DO
columnWidth = 14 !array assignment - same for all columns
CALL WriteSubtitle(titleString)
CALL writeTable(tableBody,rowHead,columnHead,columnWidth)
CALL CreateSQLiteTabularDataRecords(tableBody,rowHead,columnHead,&
'Tariff Report',&
forString,&
titleString)
DEALLOCATE(columnHead)
DEALLOCATE(rowHead)
DEALLOCATE(columnWidth)
DEALLOCATE(tableBody)
END SUBROUTINE ReportEconomicVariable