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.
 
 
 
 
 
 

208 lines
9.0 KiB

  1. module CPumpProblemsVariables
  2. use CProblemDifinition
  3. implicit none
  4. public
  5. ! Input vars
  6. type(CProblem) :: Pump1PowerFail
  7. type(CProblem) :: Pump1BlowPopOffValve
  8. type(CProblem) :: Pump2PowerFail
  9. type(CProblem) :: Pump2BlowPopOffValve
  10. type(CProblem) :: CementPumpPowerFail
  11. type(CProblem) :: CementPumpBlowPopOffValve
  12. procedure (ActionInteger), pointer :: Pump1PowerFailPtr
  13. procedure (ActionInteger), pointer :: Pump1BlowPopOffValvePtr
  14. procedure (ActionInteger), pointer :: Pump2PowerFailPtr
  15. procedure (ActionInteger), pointer :: Pump2BlowPopOffValvePtr
  16. procedure (ActionInteger), pointer :: CementPumpPowerFailPtr
  17. procedure (ActionInteger), pointer :: CementPumpBlowPopOffValvePtr
  18. contains
  19. subroutine ProcessPumpProblemsDueTime(time)
  20. implicit none
  21. integer :: time
  22. if(Pump1PowerFail%ProblemType == Time_ProblemType) call ProcessDueTime(Pump1PowerFail, ChangePump1PowerFail, time)
  23. if(Pump1BlowPopOffValve%ProblemType == Time_ProblemType) call ProcessDueTime(Pump1BlowPopOffValve, ChangePump1BlowPopOffValve, time)
  24. if(Pump2PowerFail%ProblemType == Time_ProblemType) call ProcessDueTime(Pump2PowerFail, ChangePump2PowerFail, time)
  25. if(Pump2BlowPopOffValve%ProblemType == Time_ProblemType) call ProcessDueTime(Pump2BlowPopOffValve, ChangePump2BlowPopOffValve, time)
  26. if(CementPumpPowerFail%ProblemType == Time_ProblemType) call ProcessDueTime(CementPumpPowerFail, ChangeCementPumpPowerFail, time)
  27. if(CementPumpBlowPopOffValve%ProblemType == Time_ProblemType) call ProcessDueTime(CementPumpBlowPopOffValve, ChangeCementPumpBlowPopOffValve, time)
  28. end subroutine
  29. subroutine ProcessPumpProblemsDuePumpStrokes(strokes)
  30. implicit none
  31. integer :: strokes
  32. if(Pump1PowerFail%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(Pump1PowerFail, ChangePump1PowerFail, strokes)
  33. if(Pump1BlowPopOffValve%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(Pump1BlowPopOffValve, ChangePump1BlowPopOffValve, strokes)
  34. if(Pump2PowerFail%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(Pump2PowerFail, ChangePump2PowerFail, strokes)
  35. if(Pump2BlowPopOffValve%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(Pump2BlowPopOffValve, ChangePump2BlowPopOffValve, strokes)
  36. if(CementPumpPowerFail%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(CementPumpPowerFail, ChangeCementPumpPowerFail, strokes)
  37. if(CementPumpBlowPopOffValve%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(CementPumpBlowPopOffValve, ChangeCementPumpBlowPopOffValve, strokes)
  38. end subroutine
  39. subroutine ProcessPumpProblemsDueVolumePumped(volume)
  40. implicit none
  41. real(8) :: volume
  42. if(Pump1PowerFail%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(Pump1PowerFail, ChangePump1PowerFail, volume)
  43. if(Pump1BlowPopOffValve%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(Pump1BlowPopOffValve, ChangePump1BlowPopOffValve, volume)
  44. if(Pump2PowerFail%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(Pump2PowerFail, ChangePump2PowerFail, volume)
  45. if(Pump2BlowPopOffValve%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(Pump2BlowPopOffValve, ChangePump2BlowPopOffValve, volume)
  46. if(CementPumpPowerFail%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(CementPumpPowerFail, ChangeCementPumpPowerFail, volume)
  47. if(CementPumpBlowPopOffValve%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(CementPumpBlowPopOffValve, ChangeCementPumpBlowPopOffValve, volume)
  48. end subroutine
  49. subroutine ProcessPumpProblemsDueDistanceDrilled(distance)
  50. implicit none
  51. real(8) :: distance
  52. if(Pump1PowerFail%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(Pump1PowerFail, ChangePump1PowerFail, distance)
  53. if(Pump1BlowPopOffValve%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(Pump1BlowPopOffValve, ChangePump1BlowPopOffValve, distance)
  54. if(Pump2PowerFail%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(Pump2PowerFail, ChangePump2PowerFail, distance)
  55. if(Pump2BlowPopOffValve%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(Pump2BlowPopOffValve, ChangePump2BlowPopOffValve, distance)
  56. if(CementPumpPowerFail%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(CementPumpPowerFail, ChangeCementPumpPowerFail, distance)
  57. if(CementPumpBlowPopOffValve%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(CementPumpBlowPopOffValve, ChangeCementPumpBlowPopOffValve, distance)
  58. end subroutine
  59. subroutine ChangePump1PowerFail(status)
  60. Use Pumps_VARIABLES
  61. implicit none
  62. integer, intent (in) :: status
  63. if(associated(Pump1PowerFailPtr)) call Pump1PowerFailPtr(status)
  64. if(status == Clear_StatusType) PUMP(1)%PowerFailMalf=0
  65. if(status == Executed_StatusType) PUMP(1)%PowerFailMalf=1
  66. endsubroutine
  67. subroutine ChangePump1BlowPopOffValve(status)
  68. Use Pumps_VARIABLES
  69. implicit none
  70. integer, intent (in) :: status
  71. if(associated(Pump1BlowPopOffValvePtr)) call Pump1BlowPopOffValvePtr(status)
  72. if(status == Clear_StatusType) PUMP(1)%BlowPopOffMalf=0
  73. if(status == Executed_StatusType) PUMP(1)%BlowPopOffMalf=1
  74. endsubroutine
  75. subroutine ChangePump2PowerFail(status)
  76. Use Pumps_VARIABLES
  77. implicit none
  78. integer, intent (in) :: status
  79. if(associated(Pump2PowerFailPtr)) call Pump2PowerFailPtr(status)
  80. if(status == Clear_StatusType) PUMP(2)%PowerFailMalf=0
  81. if(status == Executed_StatusType) PUMP(2)%PowerFailMalf=1
  82. endsubroutine
  83. subroutine ChangePump2BlowPopOffValve(status)
  84. Use Pumps_VARIABLES
  85. implicit none
  86. integer, intent (in) :: status
  87. if(associated(Pump2BlowPopOffValvePtr)) call Pump2BlowPopOffValvePtr(status)
  88. if(status == Clear_StatusType) PUMP(2)%BlowPopOffMalf=0
  89. if(status == Executed_StatusType) PUMP(2)%BlowPopOffMalf=1
  90. endsubroutine
  91. subroutine ChangeCementPumpPowerFail(status)
  92. Use Pumps_VARIABLES
  93. implicit none
  94. integer, intent (in) :: status
  95. if(associated(CementPumpPowerFailPtr)) call CementPumpPowerFailPtr(status)
  96. if(status == Clear_StatusType) PUMP(3)%PowerFailMalf=0
  97. if(status == Executed_StatusType) PUMP(3)%PowerFailMalf=1
  98. endsubroutine
  99. subroutine ChangeCementPumpBlowPopOffValve(status)
  100. Use Pumps_VARIABLES
  101. implicit none
  102. integer, intent (in) :: status
  103. if(associated(CementPumpBlowPopOffValvePtr)) call CementPumpBlowPopOffValvePtr(status)
  104. if(status == Clear_StatusType) PUMP(3)%BlowPopOffMalf=0
  105. if(status == Executed_StatusType) PUMP(3)%BlowPopOffMalf=1
  106. endsubroutine
  107. subroutine SubscribePump1PowerFail(v)
  108. !DEC$ ATTRIBUTES DLLEXPORT :: SubscribePump1PowerFail
  109. !DEC$ ATTRIBUTES ALIAS: 'SubscribePump1PowerFail' :: SubscribePump1PowerFail
  110. implicit none
  111. procedure (ActionInteger) :: v
  112. Pump1PowerFailPtr => v
  113. end subroutine
  114. subroutine SubscribePump1BlowPopOffValve(v)
  115. !DEC$ ATTRIBUTES DLLEXPORT :: SubscribePump1BlowPopOffValve
  116. !DEC$ ATTRIBUTES ALIAS: 'SubscribePump1BlowPopOffValve' :: SubscribePump1BlowPopOffValve
  117. implicit none
  118. procedure (ActionInteger) :: v
  119. Pump1BlowPopOffValvePtr => v
  120. end subroutine
  121. subroutine SubscribePump2PowerFail(v)
  122. !DEC$ ATTRIBUTES DLLEXPORT :: SubscribePump2PowerFail
  123. !DEC$ ATTRIBUTES ALIAS: 'SubscribePump2PowerFail' :: SubscribePump2PowerFail
  124. implicit none
  125. procedure (ActionInteger) :: v
  126. Pump2PowerFailPtr => v
  127. end subroutine
  128. subroutine SubscribePump2BlowPopOffValve(v)
  129. !DEC$ ATTRIBUTES DLLEXPORT :: SubscribePump2BlowPopOffValve
  130. !DEC$ ATTRIBUTES ALIAS: 'SubscribePump2BlowPopOffValve' :: SubscribePump2BlowPopOffValve
  131. implicit none
  132. procedure (ActionInteger) :: v
  133. Pump2BlowPopOffValvePtr => v
  134. end subroutine
  135. subroutine SubscribeCementPumpPowerFail(v)
  136. !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeCementPumpPowerFail
  137. !DEC$ ATTRIBUTES ALIAS: 'SubscribeCementPumpPowerFail' :: SubscribeCementPumpPowerFail
  138. implicit none
  139. procedure (ActionInteger) :: v
  140. CementPumpPowerFailPtr => v
  141. end subroutine
  142. subroutine SubscribeCementPumpBlowPopOffValve(v)
  143. !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeCementPumpBlowPopOffValve
  144. !DEC$ ATTRIBUTES ALIAS: 'SubscribeCementPumpBlowPopOffValve' :: SubscribeCementPumpBlowPopOffValve
  145. implicit none
  146. procedure (ActionInteger) :: v
  147. CementPumpBlowPopOffValvePtr => v
  148. end subroutine
  149. end module CPumpProblemsVariables