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 | ||
---|---|---|---|---|---|---|
logical, | intent(inout) | :: | ErrorsFound |
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 GetInputEconomicsChargeBlock(ErrorsFound)
! SUBROUTINE INFORMATION:
! AUTHOR Jason Glazer of GARD Analytics, Inc.
! DATE WRITTEN May 2004
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Read the input file for "Economics:Charge:Block" objects.
! METHODOLOGY EMPLOYED:
! REFERENCES:
! na
! USE STATEMENTS:
USE DataIPShortCuts
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
LOGICAL, INTENT(INOUT) :: ErrorsFound ! true if errors found during getting input objects.
! SUBROUTINE PARAMETER DEFINITIONS:
CHARACTER(len=*), PARAMETER :: RoutineName='GetInputEconomicsChargeBlock: '
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: iInObj ! loop index variable for reading in objects
INTEGER :: NumAlphas ! Number of elements in the alpha array
INTEGER :: NumNums ! Number of elements in the numeric array
!CHARACTER(len=MaxNameLength),DIMENSION(100) :: cAlphaArgs !character string data
!REAL(r64), DIMENSION(100) :: rNumericArgs !numeric data
INTEGER :: IOStat ! IO Status when calling get input subroutine
LOGICAL :: isNotNumeric
INTEGER :: jBlk ! loop index for blocks
INTEGER :: alphaOffset ! offset used in blocks for alpha array
REAL(r64) :: hugeNumber
INTEGER :: jFld
CHARACTER(len=MaxNameLength) :: CurrentModuleObject ! for ease in renaming.
CurrentModuleObject = 'UtilityCost:Charge:Block'
hugeNumber = HUGE(hugeNumber)
numChargeBlock = GetNumObjectsFound(CurrentModuleObject)
ALLOCATE(chargeBlock(numChargeBlock))
DO iInObj = 1 , numChargeBlock
CALL GetObjectItem(CurrentModuleObject,iInObj,cAlphaArgs,NumAlphas, &
rNumericArgs,NumNums,IOSTAT, &
AlphaBlank=lAlphaFieldBlanks,NumBlank=lNumericFieldBlanks, &
AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
!check to make sure none of the values are another economic object
DO jFld = 1, NumAlphas
IF (INDEX(MakeUpperCase(cAlphaArgs(jFld)),'UTILITYCOST:') .GT. 0) THEN
CALL ShowWarningError(RoutineName//TRIM(CurrentModuleObject)// '="' // TRIM(cAlphaArgs(1)) //'".')
CALL ShowContinueError('... a field was found containing UtilityCost: which may indicate a missing comma.')
END IF
END Do
!index of the tariff name in the tariff array
chargeBlock(iInObj)%tariffIndx = FindTariffIndex(cAlphaArgs(2),cAlphaArgs(1),ErrorsFound,CurrentModuleObject)
CALL warnIfNativeVarname(cAlphaArgs(1),chargeBlock(iInObj)%tariffIndx,ErrorsFound,CurrentModuleObject)
chargeBlock(iInObj)%namePt = AssignVariablePt(cAlphaArgs(1),.TRUE.,varIsAssigned,&
varNotYetDefined,kindChargeBlock,iInObj,chargeBlock(iInObj)%tariffIndx)
!index of the variable in the variable array
chargeBlock(iInObj)%sourcePt = AssignVariablePt(cAlphaArgs(3),.TRUE.,varIsArgument,&
varNotYetDefined,kindUnknown,0,chargeBlock(iInObj)%tariffIndx)
!enumerated list of the kind of season
chargeBlock(iInObj)%season = LookUpSeason(cAlphaArgs(4),cAlphaArgs(1))
!check to make sure a seasonal schedule is specified if the season is not annual
IF (chargeBlock(iInObj)%season .NE. seasonAnnual) THEN
IF (chargeBlock(iInObj)%tariffIndx .NE. 0) THEN
IF (tariff(chargeBlock(iInObj)%tariffIndx)%seasonSchIndex .EQ. 0) THEN
CALL ShowWarningError(RoutineName//TRIM(CurrentModuleObject)//'="'//trim(cAlphaArgs(1))//'" invalid data')
CALL ShowContinueError(trim(cAlphaFieldNames(4))//'="'//trim(cAlphaArgs(4))//'".')
CALL ShowContinueError(' a Season other than Annual is used but no Season Schedule Name is specified'// &
' in the UtilityCost:Tariff.')
END IF
END IF
END IF
!index of the category in the variable array
chargeBlock(iInObj)%categoryPt = AssignVariablePt(cAlphaArgs(5),.TRUE.,varIsAssigned,&
varNotYetDefined,kindCategory,iInObj,chargeBlock(iInObj)%tariffIndx)
!index of the remaining into variable in the variable array
chargeBlock(iInObj)%remainingPt = AssignVariablePt(cAlphaArgs(6),.TRUE.,varIsAssigned,&
varNotYetDefined,kindCategory,iInObj,chargeBlock(iInObj)%tariffIndx)
!block size multiplier
IF (LEN_TRIM(cAlphaArgs(7)) .EQ. 0) THEN !if blank
chargeBlock(iInObj)%blkSzMultVal = 1.0d0 !default is 1 if left blank
chargeBlock(iInObj)%blkSzMultPt = 0
ELSE
chargeBlock(iInObj)%blkSzMultVal = ProcessNumber(cAlphaArgs(7),isNotNumeric)
chargeBlock(iInObj)%blkSzMultPt = AssignVariablePt(cAlphaArgs(7),isNotNumeric,varIsArgument, &
varNotYetDefined,kindUnknown,0,chargeBlock(iInObj)%tariffIndx)
END IF
!number of blocks used
chargeBlock(iInObj)%numBlk = (NumAlphas - 7) / 2
DO jBlk = 1, chargeBlock(iInObj)%numBlk
alphaOffset = 7 + (jBlk - 1) * 2
!catch the "remaining" code word for the block size
IF (sameString(cAlphaArgs(alphaOffset + 1),"REMAINING")) THEN
chargeBlock(iInObj)%blkSzVal(jBlk) = hugeNumber / 1000000 !using small portion of largest possible value to prevent overflow
chargeBlock(iInObj)%blkSzPt(jBlk) = 0
ELSE
!array of block size
chargeBlock(iInObj)%blkSzVal(jBlk) = ProcessNumber(cAlphaArgs(alphaOffset + 1),isNotNumeric)
chargeBlock(iInObj)%blkSzPt(jBlk) = AssignVariablePt(cAlphaArgs(alphaOffset + 1),isNotNumeric,&
varIsArgument,varNotYetDefined,kindUnknown,0,chargeBlock(iInObj)%tariffIndx)
END IF
!array of block cost
chargeBlock(iInObj)%blkCostVal(jBlk) = ProcessNumber(cAlphaArgs(alphaOffset + 2),isNotNumeric)
chargeBlock(iInObj)%blkCostPt(jBlk) = AssignVariablePt(cAlphaArgs(alphaOffset + 2),isNotNumeric,&
varIsArgument,varNotYetDefined,kindUnknown,0,chargeBlock(iInObj)%tariffIndx)
END DO
END DO
END SUBROUTINE GetInputEconomicsChargeBlock