module CPumpProblemsVariables use CProblemDifinition implicit none public ! Input vars type :: PumpProblemsType type(CProblem) :: Pump1PowerFail type(CProblem) :: Pump1BlowPopOffValve type(CProblem) :: Pump2PowerFail type(CProblem) :: Pump2BlowPopOffValve type(CProblem) :: CementPumpPowerFail type(CProblem) :: CementPumpBlowPopOffValve end type PumpProblemsType type(PumpProblemsType)::PumpProblems ! procedure (ActionInteger), pointer :: Pump1PowerFailPtr ! procedure (ActionInteger), pointer :: Pump1BlowPopOffValvePtr ! procedure (ActionInteger), pointer :: Pump2PowerFailPtr ! procedure (ActionInteger), pointer :: Pump2BlowPopOffValvePtr ! procedure (ActionInteger), pointer :: CementPumpPowerFailPtr ! procedure (ActionInteger), pointer :: CementPumpBlowPopOffValvePtr contains subroutine ProcessPumpProblemsDueTime(time) implicit none integer :: time if(PumpProblems%Pump1PowerFail%ProblemType == Time_ProblemType) call ProcessDueTime(PumpProblems%Pump1PowerFail, ChangePump1PowerFail, time) if(PumpProblems%Pump1BlowPopOffValve%ProblemType == Time_ProblemType) call ProcessDueTime(PumpProblems%Pump1BlowPopOffValve, ChangePump1BlowPopOffValve, time) if(PumpProblems%Pump2PowerFail%ProblemType == Time_ProblemType) call ProcessDueTime(PumpProblems%Pump2PowerFail, ChangePump2PowerFail, time) if(PumpProblems%Pump2BlowPopOffValve%ProblemType == Time_ProblemType) call ProcessDueTime(PumpProblems%Pump2BlowPopOffValve, ChangePump2BlowPopOffValve, time) if(PumpProblems%CementPumpPowerFail%ProblemType == Time_ProblemType) call ProcessDueTime(PumpProblems%CementPumpPowerFail, ChangeCementPumpPowerFail, time) if(PumpProblems%CementPumpBlowPopOffValve%ProblemType == Time_ProblemType) call ProcessDueTime(PumpProblems%CementPumpBlowPopOffValve, ChangeCementPumpBlowPopOffValve, time) end subroutine subroutine ProcessPumpProblemsDuePumpStrokes(strokes) implicit none integer :: strokes if(PumpProblems%Pump1PowerFail%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(PumpProblems%Pump1PowerFail, ChangePump1PowerFail, strokes) if(PumpProblems%Pump1BlowPopOffValve%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(PumpProblems%Pump1BlowPopOffValve, ChangePump1BlowPopOffValve, strokes) if(PumpProblems%Pump2PowerFail%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(PumpProblems%Pump2PowerFail, ChangePump2PowerFail, strokes) if(PumpProblems%Pump2BlowPopOffValve%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(PumpProblems%Pump2BlowPopOffValve, ChangePump2BlowPopOffValve, strokes) if(PumpProblems%CementPumpPowerFail%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(PumpProblems%CementPumpPowerFail, ChangeCementPumpPowerFail, strokes) if(PumpProblems%CementPumpBlowPopOffValve%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(PumpProblems%CementPumpBlowPopOffValve, ChangeCementPumpBlowPopOffValve, strokes) end subroutine subroutine ProcessPumpProblemsDueVolumePumped(volume) implicit none real(8) :: volume if(PumpProblems%Pump1PowerFail%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(PumpProblems%Pump1PowerFail, ChangePump1PowerFail, volume) if(PumpProblems%Pump1BlowPopOffValve%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(PumpProblems%Pump1BlowPopOffValve, ChangePump1BlowPopOffValve, volume) if(PumpProblems%Pump2PowerFail%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(PumpProblems%Pump2PowerFail, ChangePump2PowerFail, volume) if(PumpProblems%Pump2BlowPopOffValve%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(PumpProblems%Pump2BlowPopOffValve, ChangePump2BlowPopOffValve, volume) if(PumpProblems%CementPumpPowerFail%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(PumpProblems%CementPumpPowerFail, ChangeCementPumpPowerFail, volume) if(PumpProblems%CementPumpBlowPopOffValve%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(PumpProblems%CementPumpBlowPopOffValve, ChangeCementPumpBlowPopOffValve, volume) end subroutine subroutine ProcessPumpProblemsDueDistanceDrilled(distance) implicit none real(8) :: distance if(PumpProblems%Pump1PowerFail%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(PumpProblems%Pump1PowerFail, ChangePump1PowerFail, distance) if(PumpProblems%Pump1BlowPopOffValve%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(PumpProblems%Pump1BlowPopOffValve, ChangePump1BlowPopOffValve, distance) if(PumpProblems%Pump2PowerFail%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(PumpProblems%Pump2PowerFail, ChangePump2PowerFail, distance) if(PumpProblems%Pump2BlowPopOffValve%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(PumpProblems%Pump2BlowPopOffValve, ChangePump2BlowPopOffValve, distance) if(PumpProblems%CementPumpPowerFail%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(PumpProblems%CementPumpPowerFail, ChangeCementPumpPowerFail, distance) if(PumpProblems%CementPumpBlowPopOffValve%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(PumpProblems%CementPumpBlowPopOffValve, ChangeCementPumpBlowPopOffValve, distance) end subroutine subroutine ChangePump1PowerFail(status) Use Pumps_VARIABLES implicit none integer, intent (in) :: status !if(associated(Pump1PowerFailPtr)) call Pump1PowerFailPtr(status) if(status == Clear_StatusType) PUMP(1)%PowerFailMalf=0 if(status == Executed_StatusType) PUMP(1)%PowerFailMalf=1 endsubroutine subroutine ChangePump1BlowPopOffValve(status) Use Pumps_VARIABLES implicit none integer, intent (in) :: status !if(associated(Pump1BlowPopOffValvePtr)) call Pump1BlowPopOffValvePtr(status) if(status == Clear_StatusType) PUMP(1)%BlowPopOffMalf=0 if(status == Executed_StatusType) PUMP(1)%BlowPopOffMalf=1 endsubroutine subroutine ChangePump2PowerFail(status) Use Pumps_VARIABLES implicit none integer, intent (in) :: status !if(associated(Pump2PowerFailPtr)) call Pump2PowerFailPtr(status) if(status == Clear_StatusType) PUMP(2)%PowerFailMalf=0 if(status == Executed_StatusType) PUMP(2)%PowerFailMalf=1 endsubroutine subroutine ChangePump2BlowPopOffValve(status) Use Pumps_VARIABLES implicit none integer, intent (in) :: status !if(associated(Pump2BlowPopOffValvePtr)) call Pump2BlowPopOffValvePtr(status) if(status == Clear_StatusType) PUMP(2)%BlowPopOffMalf=0 if(status == Executed_StatusType) PUMP(2)%BlowPopOffMalf=1 endsubroutine subroutine ChangeCementPumpPowerFail(status) Use Pumps_VARIABLES implicit none integer, intent (in) :: status !if(associated(CementPumpPowerFailPtr)) call CementPumpPowerFailPtr(status) if(status == Clear_StatusType) PUMP(3)%PowerFailMalf=0 if(status == Executed_StatusType) PUMP(3)%PowerFailMalf=1 endsubroutine subroutine ChangeCementPumpBlowPopOffValve(status) Use Pumps_VARIABLES implicit none integer, intent (in) :: status !if(associated(CementPumpBlowPopOffValvePtr)) call CementPumpBlowPopOffValvePtr(status) if(status == Clear_StatusType) PUMP(3)%BlowPopOffMalf=0 if(status == Executed_StatusType) PUMP(3)%BlowPopOffMalf=1 endsubroutine end module CPumpProblemsVariables