!-------------------------------BEGIN ADD--------------------------------- !An ADD file has declarations, derived type definitions, etc. to be included at... !the top of the Client Module, followed by CONTAINS statement and then all of ... !the procedures developed by the analyst to include in the Client Module of a ... !given model. !------------------------------------------------------------------------- !Insert model-level declarations here, if any !----- !Max number of zones in terms of route duration INTEGER(KIND=tny),PARAMETER:: tnyMaxZones = 3 !----- !Number of roundtrip days by zone INTEGER(KIND=tny),DIMENSION(tnyMaxZones):: tnyTripDays !----- !Fleet trucks dispatched to ecah zone on a given day INTEGER(KIND=reg),DIMENSION(tnyMaxZones):: regFleetDispatch !----- !Weekly fleet operating costs by zones REAL(KIND=dbl),DIMENSION(tnyMaxZones):: dblFleetOpCost !----- !Loads outsourced by zones INTEGER(KIND=reg),DIMENSION(tnyMaxZones):: regOutSource !----- !Weekly outsourcing costs by zones REAL(KIND=dbl),DIMENSION(tnyMaxZones):: dblOutSourceCost !----- !Loads carried by trucks in fleet to each route zone INTEGER(KIND=reg),DIMENSION(tnyMaxZones):: regFleetRuns !----- !Outsouced truckloads by route zones INTEGER(KIND=reg),DIMENSION(tnyMaxZones):: regOutSrcRuns !----- TYPE MinMaxObj INTEGER(KIND=reg):: regMaxVal INTEGER(KIND=reg):: regMinVal CHARACTER(len=9):: strMaxValDay CHARACTER(len=9):: strMinValDay END TYPE MinMaxObj !----- !Tracking demand (and other) min & max info TYPE(MinMaxObj):: mmxInit = MinMaxObj(0,regBigM," "," ") !Dummy for initializing others TYPE(MinMaxObj):: mmxDemand TYPE(MinMaxObj):: mmxEnroute !total en route TYPE(MinMaxObj):: mmxOutSource TYPE(MinMaxObj):: mmxIdle !----- CONTAINS !the following procedures... !----- !Insert procedures here, if any !------------------------------------------------------------------------- SUBROUTINE AccumulateOpCost(dblCostSum,dblCost,dblDailyCost,tnyDuration,regTrucks) INTEGER(KIND=tny),DIMENSION(:):: tnyDuration INTEGER(KIND=reg),DIMENSION(:):: regTrucks REAL(KIND=dbl):: dblDailyCost,dblCostSum REAL(KIND=dbl),DIMENSION(:):: dblCost REAL(KIND=dbl),DIMENSION(1:SIZE(tnyDuration)):: dblOpCost !----- WRITE(9,*)"dblCost",dblCost dblOpCost(:) = dblDailyCost * tnyDuration(:) * regTrucks(:) dblCost(:) = dblCost(:) + dblOpCost(:) dblCostSum = SUM(dblCost(:)) WRITE(9,*)"dblDailyCost",dblDailyCost WRITE(9,*)"tnyDuration",tnyDuration(:) WRITE(9,*)"regTrucks",regTrucks(:) WRITE(9,*)"dblOpCost",dblOpCost(:) WRITE(9,*)"dblCost",dblCost(:) WRITE(9,*)"dblCostSum",dblCostSum END SUBROUTINE AccumulateOpCost !------------------------------------------------------------------------- SUBROUTINE TrackMinMax(mmxObj,regValue,strDayofWeek) INTEGER(KIND=reg),INTENT(IN):: regValue CHARACTER(len=9),INTENT(IN):: strDayofWeek TYPE(MinMaxObj):: mmxObj !----- WRITE(9,*)"mmxObj",mmxObj,strDayofWeek IF(regValue > mmxObj%regMaxVal)THEN mmxObj%regMaxVal = regValue mmxObj%strMaxValDay = strDayofWeek ELSEIF(regValue < mmxObj%regMinVal)THEN mmxObj%regMinVal = regValue mmxObj%strMinValDay = strDayofWeek ENDIF !----- END SUBROUTINE TrackMinMax !--------------------------------END ADD----------------------------------