Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | objName | |||
integer, | intent(in) | :: | curTariffIndex | |||
logical, | intent(inout) | :: | ErrorsFound | |||
character(len=*), | intent(in) | :: | curobjName |
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 warnIfNativeVarname(objName,curTariffIndex,ErrorsFound,curobjName)
! SUBROUTINE INFORMATION:
! AUTHOR Jason Glazer of GARD Analytics, Inc.
! DATE WRITTEN March 2007
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Issue a warning if the variable name (usually the object name) is
! one of the names of native variables
! METHODOLOGY EMPLOYED:
! REFERENCES:
! na
! USE STATEMENTS:
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
CHARACTER(len=*), INTENT(IN) :: objName
INTEGER, INTENT(IN) :: curTariffIndex
LOGICAL, INTENT(INOUT) :: ErrorsFound
CHARACTER(len=*), INTENT(IN) :: curobjName
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
LOGICAL :: throwError
throwError = .FALSE.
IF (SameString(objName,'TotalEnergy')) throwError = .TRUE.
IF (SameString(objName,'TotalDemand')) throwError = .TRUE.
IF (SameString(objName,'PeakEnergy')) throwError = .TRUE.
IF (SameString(objName,'PeakDemand')) throwError = .TRUE.
IF (SameString(objName,'ShoulderEnergy')) throwError = .TRUE.
IF (SameString(objName,'ShoulderDemand')) throwError = .TRUE.
IF (SameString(objName,'OffPeakEnergy')) throwError = .TRUE.
IF (SameString(objName,'OffPeakDemand')) throwError = .TRUE.
IF (SameString(objName,'MidPeakEnergy')) throwError = .TRUE.
IF (SameString(objName,'MidPeakDemand')) throwError = .TRUE.
IF (SameString(objName,'PeakExceedsOffPeak')) throwError = .TRUE.
IF (SameString(objName,'OffPeakExceedsPeak')) throwError = .TRUE.
IF (SameString(objName,'PeakExceedsMidPeak')) throwError = .TRUE.
IF (SameString(objName,'MidPeakExceedsPeak')) throwError = .TRUE.
IF (SameString(objName,'PeakExceedsShoulder')) throwError = .TRUE.
IF (SameString(objName,'ShoulderExceedsPeak')) throwError = .TRUE.
IF (SameString(objName,'IsWinter')) throwError = .TRUE.
IF (SameString(objName,'IsNotWinter')) throwError = .TRUE.
IF (SameString(objName,'IsSpring')) throwError = .TRUE.
IF (SameString(objName,'IsNotSpring')) throwError = .TRUE.
IF (SameString(objName,'IsSummer')) throwError = .TRUE.
IF (SameString(objName,'IsNotSummer')) throwError = .TRUE.
IF (SameString(objName,'IsAutumn')) throwError = .TRUE.
IF (SameString(objName,'IsNotAutumn')) throwError = .TRUE.
IF (SameString(objName,'PeakAndShoulderEnergy')) throwError = .TRUE.
IF (SameString(objName,'PeakAndShoulderDemand')) throwError = .TRUE.
IF (SameString(objName,'PeakAndMidPeakEnergy')) throwError = .TRUE.
IF (SameString(objName,'PeakAndMidPeakDemand')) throwError = .TRUE.
IF (SameString(objName,'ShoulderAndOffPeakEnergy')) throwError = .TRUE.
IF (SameString(objName,'ShoulderAndOffPeakDemand')) throwError = .TRUE.
IF (SameString(objName,'PeakAndOffPeakEnergy')) throwError = .TRUE.
IF (SameString(objName,'PeakAndOffPeakDemand')) throwError = .TRUE.
IF (SameString(objName,'RealTimePriceCosts')) throwError = .TRUE.
IF (SameString(objName,'AboveCustomerBaseCosts')) throwError = .TRUE.
IF (SameString(objName,'BelowCustomerBaseCosts')) throwError = .TRUE.
IF (SameString(objName,'AboveCustomerBaseEnergy')) throwError = .TRUE.
IF (SameString(objName,'BelowCustomerBaseEnergy')) throwError = .TRUE.
IF (SameString(objName,'EnergyCharges')) throwError = .TRUE.
IF (SameString(objName,'DemandCharges')) throwError = .TRUE.
IF (SameString(objName,'ServiceCharges')) throwError = .TRUE.
IF (SameString(objName,'Basis')) throwError = .TRUE.
IF (SameString(objName,'Surcharges')) throwError = .TRUE.
IF (SameString(objName,'Adjustments')) throwError = .TRUE.
IF (SameString(objName,'Subtotal')) throwError = .TRUE.
IF (SameString(objName,'Taxes')) throwError = .TRUE.
IF (SameString(objName,'Total')) throwError = .TRUE.
IF (throwError) THEN
ErrorsFound=.true.
IF (curTariffIndex .GE. 1 .AND. curTariffIndex .LE. numTariff) THEN
CALL ShowSevereError('UtilityCost:Tariff="'//trim(tariff(curTariffIndex)%tariffName)//'" invalid referenced name')
CALL ShowContinueError(trim(curobjName)//'="'//trim(objName)// &
'" You cannot name an object using the same name as a native variable.')
ELSE
CALL ShowSevereError(trim(curobjname)//'="'//trim(objname)// &
'" You cannot name an object using the same name as a native variable.')
END IF
END IF
END SUBROUTINE warnIfNativeVarname