Simulation Core
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

158 lines
8.0 KiB

  1. module CPumpProblemsVariables
  2. use CProblemDifinition
  3. implicit none
  4. public
  5. ! Input vars
  6. type :: PumpProblemsType
  7. type(CProblem) :: Pump1PowerFail
  8. type(CProblem) :: Pump1BlowPopOffValve
  9. type(CProblem) :: Pump2PowerFail
  10. type(CProblem) :: Pump2BlowPopOffValve
  11. type(CProblem) :: CementPumpPowerFail
  12. type(CProblem) :: CementPumpBlowPopOffValve
  13. end type PumpProblemsType
  14. type(PumpProblemsType)::PumpProblems
  15. ! procedure (ActionInteger), pointer :: Pump1PowerFailPtr
  16. ! procedure (ActionInteger), pointer :: Pump1BlowPopOffValvePtr
  17. ! procedure (ActionInteger), pointer :: Pump2PowerFailPtr
  18. ! procedure (ActionInteger), pointer :: Pump2BlowPopOffValvePtr
  19. ! procedure (ActionInteger), pointer :: CementPumpPowerFailPtr
  20. ! procedure (ActionInteger), pointer :: CementPumpBlowPopOffValvePtr
  21. contains
  22. subroutine ProcessPumpProblemsDueTime(time)
  23. implicit none
  24. integer :: time
  25. if(PumpProblems%Pump1PowerFail%ProblemType == Time_ProblemType) call ProcessDueTime(PumpProblems%Pump1PowerFail, ChangePump1PowerFail, time)
  26. if(PumpProblems%Pump1BlowPopOffValve%ProblemType == Time_ProblemType) call ProcessDueTime(PumpProblems%Pump1BlowPopOffValve, ChangePump1BlowPopOffValve, time)
  27. if(PumpProblems%Pump2PowerFail%ProblemType == Time_ProblemType) call ProcessDueTime(PumpProblems%Pump2PowerFail, ChangePump2PowerFail, time)
  28. if(PumpProblems%Pump2BlowPopOffValve%ProblemType == Time_ProblemType) call ProcessDueTime(PumpProblems%Pump2BlowPopOffValve, ChangePump2BlowPopOffValve, time)
  29. if(PumpProblems%CementPumpPowerFail%ProblemType == Time_ProblemType) call ProcessDueTime(PumpProblems%CementPumpPowerFail, ChangeCementPumpPowerFail, time)
  30. if(PumpProblems%CementPumpBlowPopOffValve%ProblemType == Time_ProblemType) call ProcessDueTime(PumpProblems%CementPumpBlowPopOffValve, ChangeCementPumpBlowPopOffValve, time)
  31. end subroutine
  32. subroutine ProcessPumpProblemsDuePumpStrokes(strokes)
  33. implicit none
  34. integer :: strokes
  35. if(PumpProblems%Pump1PowerFail%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(PumpProblems%Pump1PowerFail, ChangePump1PowerFail, strokes)
  36. if(PumpProblems%Pump1BlowPopOffValve%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(PumpProblems%Pump1BlowPopOffValve, ChangePump1BlowPopOffValve, strokes)
  37. if(PumpProblems%Pump2PowerFail%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(PumpProblems%Pump2PowerFail, ChangePump2PowerFail, strokes)
  38. if(PumpProblems%Pump2BlowPopOffValve%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(PumpProblems%Pump2BlowPopOffValve, ChangePump2BlowPopOffValve, strokes)
  39. if(PumpProblems%CementPumpPowerFail%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(PumpProblems%CementPumpPowerFail, ChangeCementPumpPowerFail, strokes)
  40. if(PumpProblems%CementPumpBlowPopOffValve%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(PumpProblems%CementPumpBlowPopOffValve, ChangeCementPumpBlowPopOffValve, strokes)
  41. end subroutine
  42. subroutine ProcessPumpProblemsDueVolumePumped(volume)
  43. implicit none
  44. real(8) :: volume
  45. if(PumpProblems%Pump1PowerFail%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(PumpProblems%Pump1PowerFail, ChangePump1PowerFail, volume)
  46. if(PumpProblems%Pump1BlowPopOffValve%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(PumpProblems%Pump1BlowPopOffValve, ChangePump1BlowPopOffValve, volume)
  47. if(PumpProblems%Pump2PowerFail%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(PumpProblems%Pump2PowerFail, ChangePump2PowerFail, volume)
  48. if(PumpProblems%Pump2BlowPopOffValve%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(PumpProblems%Pump2BlowPopOffValve, ChangePump2BlowPopOffValve, volume)
  49. if(PumpProblems%CementPumpPowerFail%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(PumpProblems%CementPumpPowerFail, ChangeCementPumpPowerFail, volume)
  50. if(PumpProblems%CementPumpBlowPopOffValve%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(PumpProblems%CementPumpBlowPopOffValve, ChangeCementPumpBlowPopOffValve, volume)
  51. end subroutine
  52. subroutine ProcessPumpProblemsDueDistanceDrilled(distance)
  53. implicit none
  54. real(8) :: distance
  55. if(PumpProblems%Pump1PowerFail%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(PumpProblems%Pump1PowerFail, ChangePump1PowerFail, distance)
  56. if(PumpProblems%Pump1BlowPopOffValve%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(PumpProblems%Pump1BlowPopOffValve, ChangePump1BlowPopOffValve, distance)
  57. if(PumpProblems%Pump2PowerFail%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(PumpProblems%Pump2PowerFail, ChangePump2PowerFail, distance)
  58. if(PumpProblems%Pump2BlowPopOffValve%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(PumpProblems%Pump2BlowPopOffValve, ChangePump2BlowPopOffValve, distance)
  59. if(PumpProblems%CementPumpPowerFail%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(PumpProblems%CementPumpPowerFail, ChangeCementPumpPowerFail, distance)
  60. if(PumpProblems%CementPumpBlowPopOffValve%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(PumpProblems%CementPumpBlowPopOffValve, ChangeCementPumpBlowPopOffValve, distance)
  61. end subroutine
  62. subroutine ChangePump1PowerFail(status)
  63. Use Pumps_VARIABLES
  64. implicit none
  65. integer, intent (in) :: status
  66. !if(associated(Pump1PowerFailPtr)) call Pump1PowerFailPtr(status)
  67. if(status == Clear_StatusType) PUMP(1)%PowerFailMalf=0
  68. if(status == Executed_StatusType) PUMP(1)%PowerFailMalf=1
  69. endsubroutine
  70. subroutine ChangePump1BlowPopOffValve(status)
  71. Use Pumps_VARIABLES
  72. implicit none
  73. integer, intent (in) :: status
  74. !if(associated(Pump1BlowPopOffValvePtr)) call Pump1BlowPopOffValvePtr(status)
  75. if(status == Clear_StatusType) PUMP(1)%BlowPopOffMalf=0
  76. if(status == Executed_StatusType) PUMP(1)%BlowPopOffMalf=1
  77. endsubroutine
  78. subroutine ChangePump2PowerFail(status)
  79. Use Pumps_VARIABLES
  80. implicit none
  81. integer, intent (in) :: status
  82. !if(associated(Pump2PowerFailPtr)) call Pump2PowerFailPtr(status)
  83. if(status == Clear_StatusType) PUMP(2)%PowerFailMalf=0
  84. if(status == Executed_StatusType) PUMP(2)%PowerFailMalf=1
  85. endsubroutine
  86. subroutine ChangePump2BlowPopOffValve(status)
  87. Use Pumps_VARIABLES
  88. implicit none
  89. integer, intent (in) :: status
  90. !if(associated(Pump2BlowPopOffValvePtr)) call Pump2BlowPopOffValvePtr(status)
  91. if(status == Clear_StatusType) PUMP(2)%BlowPopOffMalf=0
  92. if(status == Executed_StatusType) PUMP(2)%BlowPopOffMalf=1
  93. endsubroutine
  94. subroutine ChangeCementPumpPowerFail(status)
  95. Use Pumps_VARIABLES
  96. implicit none
  97. integer, intent (in) :: status
  98. !if(associated(CementPumpPowerFailPtr)) call CementPumpPowerFailPtr(status)
  99. if(status == Clear_StatusType) PUMP(3)%PowerFailMalf=0
  100. if(status == Executed_StatusType) PUMP(3)%PowerFailMalf=1
  101. endsubroutine
  102. subroutine ChangeCementPumpBlowPopOffValve(status)
  103. Use Pumps_VARIABLES
  104. implicit none
  105. integer, intent (in) :: status
  106. !if(associated(CementPumpBlowPopOffValvePtr)) call CementPumpBlowPopOffValvePtr(status)
  107. if(status == Clear_StatusType) PUMP(3)%BlowPopOffMalf=0
  108. if(status == Executed_StatusType) PUMP(3)%BlowPopOffMalf=1
  109. endsubroutine
  110. end module CPumpProblemsVariables