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 GetInputLifeCycleCostNonrecurringCost
! SUBROUTINE INFORMATION:
! AUTHOR Jason Glazer of GARD Analytics, Inc.
! DATE WRITTEN May 2010
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Read the input file for "LifeCycleCost:NonrecurringCost" object.
! METHODOLOGY EMPLOYED:
! REFERENCES:
! na
! USE STATEMENTS:
! na
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
! na
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: iInObj ! loop index variable for reading in objects
INTEGER :: jFld
INTEGER :: NumAlphas ! Number of elements in the alpha array
INTEGER :: NumNums ! Number of elements in the numeric array
CHARACTER(len=MaxNameLength),DIMENSION(100) :: AlphaArray !character string data
REAL(r64), DIMENSION(100) :: NumArray !numeric data
INTEGER :: IOStat ! IO Status when calling get input subroutine
CHARACTER(len=MaxNameLength) :: CurrentModuleObject ! for ease in renaming.
INTEGER :: numComponentCostLineItems !number of ComponentCost:LineItem objects
IF (.NOT. LCCparamPresent) RETURN
CurrentModuleObject = 'LifeCycleCost:NonrecurringCost'
numNonrecurringCost = GetNumObjectsFound(CurrentModuleObject)
numComponentCostLineItems = GetNumObjectsFound('ComponentCost:LineItem')
IF (numComponentCostLineItems .GT. 0) THEN !leave room for component cost total
ALLOCATE(NonrecurringCost(numNonrecurringCost + 1)) !add a place for CostEstimate total
ELSE
ALLOCATE(NonrecurringCost(numNonrecurringCost))
END IF
DO iInObj = 1 , numNonrecurringCost
CALL GetObjectItem(CurrentModuleObject,iInObj,AlphaArray,NumAlphas,NumArray,NumNums,IOSTAT, &
AlphaBlank=lAlphaFieldBlanks,NumBlank=lNumericFieldBlanks, &
AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
!check to make sure none of the values are another life cycle cost object
DO jFld = 1, NumAlphas
IF (INDEX(MakeUpperCase(AlphaArray(jFld)),'LifeCycleCost:') .GT. 0) THEN
CALL ShowWarningError('In '//TRIM(CurrentModuleObject)//' named ' // TRIM(AlphaArray(1)) // &
' a field was found containing LifeCycleCost: which may indicate a missing comma.')
END IF
END DO
! start to extract values from input array into appropriate fields
! A1, \field Name
! \required-field
! \type alpha
NonrecurringCost(iInObj)%Name = AlphaArray(1)
! A2, \field Category
! \type choice
! \key Construction
! \key Salvage
! \key OtherCapital
! \default Construction
IF (SameString(AlphaArray(2),'Construction')) THEN
NonrecurringCost(iInObj)%category = costCatConstruction
ELSEIF (SameString(AlphaArray(2),'Salvage')) THEN
NonrecurringCost(iInObj)%category = costCatSalvage
ELSEIF (SameString(AlphaArray(2),'OtherCapital')) THEN
NonrecurringCost(iInObj)%category = costCatOtherCapital
ELSE
NonrecurringCost(iInObj)%category = costCatConstruction
CALL ShowWarningError(TRIM(CurrentModuleObject)//': Invalid '//TRIM(cAlphaFieldNames(2))//'="'// &
TRIM(AlphaArray(2))//'". The category of Construction will be used.')
END IF
! N1, \field Cost
! \type real
NonrecurringCost(iInObj)%cost = NumArray(1)
! A3, \field Start of Costs
! \type choice
! \key ServicePeriod
! \key BasePeriod
! \default ServicePeriod
IF (SameString(AlphaArray(3),'ServicePeriod')) THEN
NonrecurringCost(iInObj)%startOfCosts = startServicePeriod
ELSEIF (SameString(AlphaArray(3),'BasePeriod')) THEN
NonrecurringCost(iInObj)%startOfCosts = startBasePeriod
ELSE
NonrecurringCost(iInObj)%startOfCosts = startServicePeriod
CALL ShowWarningError(TRIM(CurrentModuleObject)//': Invalid '//TRIM(cAlphaFieldNames(3))//'="'// &
TRIM(AlphaArray(3))//'". The start of the service period will be used.')
END IF
! N2, \field Years from Start
! \type integer
! \minimum 0
! \maximum 100
NonrecurringCost(iInObj)%yearsFromStart = INT(NumArray(2))
IF (NonrecurringCost(iInObj)%yearsFromStart .GT. 100) THEN
CALL ShowWarningError(TRIM(CurrentModuleObject)//': Invalid value in field '//TRIM(cNumericFieldNames(2))// &
'. This value is the number of years from the start so a value greater than 100 '// &
'is not reasonable for an economic evaluation. ')
END IF
IF (NonrecurringCost(iInObj)%yearsFromStart .LT. 0) THEN
CALL ShowWarningError(TRIM(CurrentModuleObject)//': Invalid value in field '//TRIM(cNumericFieldNames(2))// &
'. This value is the number of years from the start so a value less than 0 is not reasonable for an economic evaluation. ')
END IF
! N3; \field Months from Start
! \type integer
! \minimum 0
! \maximum 11
NonrecurringCost(iInObj)%monthsFromStart = INT(NumArray(3))
IF (NonrecurringCost(iInObj)%monthsFromStart .GT. 1200) THEN
CALL ShowWarningError(TRIM(CurrentModuleObject)//': Invalid value in field '//TRIM(cNumericFieldNames(3))// &
'. This value is the number of months from the start so a value greater than 1200 '// &
'is not reasonable for an economic evaluation. ')
END IF
IF (NonrecurringCost(iInObj)%monthsFromStart .LT. 0) THEN
CALL ShowWarningError(TRIM(CurrentModuleObject)//': Invalid value in field '//TRIM(cNumericFieldNames(3))// &
'. This value is the number of months from the start so a value less than 0 '// &
'is not reasonable for an economic evaluation. ')
END IF
! express the years and months fields in total months
NonrecurringCost(iInObj)%totalMonthsFromStart = NonrecurringCost(iInObj)%yearsFromStart * 12 + &
NonrecurringCost(iInObj)%monthsFromStart
END DO
END SUBROUTINE GetInputLifeCycleCostNonrecurringCost