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.
 
 
 
 
 
 

302 lines
14 KiB

  1. module COtherProblemsVariables
  2. use CProblemDifinition
  3. implicit none
  4. public
  5. ! Input vars
  6. TYPE:: OtherProblemsType
  7. type(CProblem) :: RigAlarm
  8. type(CProblem) :: RigWaterSupply
  9. type(CProblem) :: RigAir
  10. type(CProblem) :: Gen1
  11. type(CProblem) :: Gen2
  12. type(CProblem) :: Gen3
  13. type(CProblem) :: Gen4
  14. type(CProblem) :: Scr1
  15. type(CProblem) :: Scr2
  16. type(CProblem) :: Scr3
  17. type(CProblem) :: Scr4
  18. end type OtherProblemsType
  19. type(OtherProblemsType)::OtherProblems
  20. ! procedure (ActionInteger), pointer :: RigAlarmPtr
  21. ! procedure (ActionInteger), pointer :: RigWaterSupplyPtr
  22. ! procedure (ActionInteger), pointer :: RigAirPtr
  23. ! procedure (ActionInteger), pointer :: Gen1Ptr
  24. ! procedure (ActionInteger), pointer :: Gen2Ptr
  25. ! procedure (ActionInteger), pointer :: Gen3Ptr
  26. ! procedure (ActionInteger), pointer :: Gen4Ptr
  27. ! procedure (ActionInteger), pointer :: Scr1Ptr
  28. ! procedure (ActionInteger), pointer :: Scr2Ptr
  29. ! procedure (ActionInteger), pointer :: Scr3Ptr
  30. ! procedure (ActionInteger), pointer :: Scr4Ptr
  31. contains
  32. subroutine ProcessOtherProblemsDueTime(time)
  33. implicit none
  34. integer :: time
  35. if(OtherProblems%RigAlarm%ProblemType == Time_ProblemType) call ProcessDueTime(OtherProblems%RigAlarm, ChangeRigAlarm, time)
  36. if(OtherProblems%RigWaterSupply%ProblemType == Time_ProblemType) call ProcessDueTime(OtherProblems%RigWaterSupply, ChangeRigWaterSupply, time)
  37. if(OtherProblems%RigAir%ProblemType == Time_ProblemType) call ProcessDueTime(OtherProblems%RigAir, ChangeRigAir, time)
  38. if(OtherProblems%Gen1%ProblemType == Time_ProblemType) call ProcessDueTime(OtherProblems%Gen1, ChangeGen1, time)
  39. if(OtherProblems%Gen2%ProblemType == Time_ProblemType) call ProcessDueTime(OtherProblems%Gen2, ChangeGen2, time)
  40. if(OtherProblems%Gen3%ProblemType == Time_ProblemType) call ProcessDueTime(OtherProblems%Gen3, ChangeGen3, time)
  41. if(OtherProblems%Gen4%ProblemType == Time_ProblemType) call ProcessDueTime(OtherProblems%Gen4, ChangeGen4, time)
  42. if(OtherProblems%Scr1%ProblemType == Time_ProblemType) call ProcessDueTime(OtherProblems%Scr1, ChangeScr1, time)
  43. if(OtherProblems%Scr2%ProblemType == Time_ProblemType) call ProcessDueTime(OtherProblems%Scr2, ChangeScr2, time)
  44. if(OtherProblems%Scr3%ProblemType == Time_ProblemType) call ProcessDueTime(OtherProblems%Scr3, ChangeScr3, time)
  45. if(OtherProblems%Scr4%ProblemType == Time_ProblemType) call ProcessDueTime(OtherProblems%Scr4, ChangeScr4, time)
  46. end subroutine
  47. subroutine ProcessOtherProblemsDuePumpStrokes(strokes)
  48. implicit none
  49. integer :: strokes
  50. if(OtherProblems%RigAlarm%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(OtherProblems%RigAlarm, ChangeRigAlarm, strokes)
  51. if(OtherProblems%RigWaterSupply%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(OtherProblems%RigWaterSupply, ChangeRigWaterSupply, strokes)
  52. if(OtherProblems%RigAir%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(OtherProblems%RigAir, ChangeRigAir, strokes)
  53. if(OtherProblems%Gen1%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(OtherProblems%Gen1, ChangeGen1, strokes)
  54. if(OtherProblems%Gen2%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(OtherProblems%Gen2, ChangeGen2, strokes)
  55. if(OtherProblems%Gen3%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(OtherProblems%Gen3, ChangeGen3, strokes)
  56. if(OtherProblems%Gen4%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(OtherProblems%Gen4, ChangeGen4, strokes)
  57. if(OtherProblems%Scr1%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(OtherProblems%Scr1, ChangeScr1, strokes)
  58. if(OtherProblems%Scr2%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(OtherProblems%Scr2, ChangeScr2, strokes)
  59. if(OtherProblems%Scr3%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(OtherProblems%Scr3, ChangeScr3, strokes)
  60. if(OtherProblems%Scr4%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(OtherProblems%Scr4, ChangeScr4, strokes)
  61. end subroutine
  62. subroutine ProcessOtherProblemsDueVolumePumped(volume)
  63. implicit none
  64. real(8) :: volume
  65. if(OtherProblems%RigAlarm%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(OtherProblems%RigAlarm, ChangeRigAlarm, volume)
  66. if(OtherProblems%RigWaterSupply%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(OtherProblems%RigWaterSupply, ChangeRigWaterSupply, volume)
  67. if(OtherProblems%RigAir%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(OtherProblems%RigAir, ChangeRigAir, volume)
  68. if(OtherProblems%Gen1%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(OtherProblems%Gen1, ChangeGen1, volume)
  69. if(OtherProblems%Gen2%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(OtherProblems%Gen2, ChangeGen2, volume)
  70. if(OtherProblems%Gen3%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(OtherProblems%Gen3, ChangeGen3, volume)
  71. if(OtherProblems%Gen4%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(OtherProblems%Gen4, ChangeGen4, volume)
  72. if(OtherProblems%Scr1%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(OtherProblems%Scr1, ChangeScr1, volume)
  73. if(OtherProblems%Scr2%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(OtherProblems%Scr2, ChangeScr2, volume)
  74. if(OtherProblems%Scr3%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(OtherProblems%Scr3, ChangeScr3, volume)
  75. if(OtherProblems%Scr4%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(OtherProblems%Scr4, ChangeScr4, volume)
  76. end subroutine
  77. subroutine ProcessOtherProblemsDueDistanceDrilled(distance)
  78. implicit none
  79. real(8) :: distance
  80. if(OtherProblems%RigAlarm%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(OtherProblems%RigAlarm, ChangeRigAlarm, distance)
  81. if(OtherProblems%RigWaterSupply%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(OtherProblems%RigWaterSupply, ChangeRigWaterSupply, distance)
  82. if(OtherProblems%RigAir%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(OtherProblems%RigAir, ChangeRigAir, distance)
  83. if(OtherProblems%Gen1%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(OtherProblems%Gen1, ChangeGen1, distance)
  84. if(OtherProblems%Gen2%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(OtherProblems%Gen2, ChangeGen2, distance)
  85. if(OtherProblems%Gen3%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(OtherProblems%Gen3, ChangeGen3, distance)
  86. if(OtherProblems%Gen4%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(OtherProblems%Gen4, ChangeGen4, distance)
  87. if(OtherProblems%Scr1%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(OtherProblems%Scr1, ChangeScr1, distance)
  88. if(OtherProblems%Scr2%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(OtherProblems%Scr2, ChangeScr2, distance)
  89. if(OtherProblems%Scr3%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(OtherProblems%Scr3, ChangeScr3, distance)
  90. if(OtherProblems%Scr4%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(OtherProblems%Scr4, ChangeScr4, distance)
  91. end subroutine
  92. subroutine ChangeRigAlarm(status)
  93. implicit none
  94. integer, intent (in) :: status
  95. !if(associated(RigAlarmPtr)) call RigAlarmPtr(status)
  96. !if(status == Clear_StatusType) print*,'On_RigAlarm_Clear'
  97. !if(status == Executed_StatusType) print*,'On_RigAlarm_Execute'
  98. endsubroutine
  99. subroutine ChangeRigWaterSupply(status)
  100. implicit none
  101. integer, intent (in) :: status
  102. !if(associated(RigWaterSupplyPtr)) call RigWaterSupplyPtr(status)
  103. !if(status == Clear_StatusType) print*,'On_RigWaterSupply_Clear'
  104. !if(status == Executed_StatusType) print*,'On_RigWaterSupply_Execute'
  105. endsubroutine
  106. subroutine ChangeRigAir(status)
  107. use VARIABLES
  108. implicit none
  109. integer, intent (in) :: status
  110. !if(associated(RigAirPtr)) call RigAirPtr(status)
  111. if(status == Clear_StatusType) BopStackAcc%RigAirMalf = 0
  112. if(status == Executed_StatusType) BopStackAcc%RigAirMalf = 1
  113. endsubroutine
  114. subroutine ChangeGen1(status)
  115. implicit none
  116. integer, intent (in) :: status
  117. !if(associated(Gen1Ptr)) call Gen1Ptr(status)
  118. !if(status == Clear_StatusType) print*,'On_Gen1_Clear'
  119. !if(status == Executed_StatusType) print*,'On_Gen1_Execute'
  120. endsubroutine
  121. subroutine ChangeGen2(status)
  122. implicit none
  123. integer, intent (in) :: status
  124. !if(associated(Gen2Ptr)) call Gen2Ptr(status)
  125. !if(status == Clear_StatusType) print*,'On_Gen2_Clear'
  126. !if(status == Executed_StatusType) print*,'On_Gen2_Execute'
  127. endsubroutine
  128. subroutine ChangeGen3(status)
  129. implicit none
  130. integer, intent (in) :: status
  131. !if(associated(Gen3Ptr)) call Gen3Ptr(status)
  132. !if(status == Clear_StatusType) print*,'On_Gen3_Clear'
  133. !if(status == Executed_StatusType) print*,'On_Gen3_Execute'
  134. endsubroutine
  135. subroutine ChangeGen4(status)
  136. implicit none
  137. integer, intent (in) :: status
  138. !if(associated(Gen4Ptr)) call Gen4Ptr(status)
  139. !if(status == Clear_StatusType) print*,'On_Gen4_Clear'
  140. !if(status == Executed_StatusType) print*,'On_Gen4_Execute'
  141. endsubroutine
  142. subroutine ChangeScr1(status)
  143. implicit none
  144. integer, intent (in) :: status
  145. !if(associated(Scr1Ptr)) call Scr1Ptr(status)
  146. !if(status == Clear_StatusType) print*,'On_Scr1_Clear'
  147. !if(status == Executed_StatusType) print*,'On_Scr1_Execute'
  148. endsubroutine
  149. subroutine ChangeScr2(status)
  150. implicit none
  151. integer, intent (in) :: status
  152. !if(associated(Scr2Ptr)) call Scr2Ptr(status)
  153. !if(status == Clear_StatusType) print*,'On_Scr2_Clear'
  154. !if(status == Executed_StatusType) print*,'On_Scr2_Execute'
  155. endsubroutine
  156. subroutine ChangeScr3(status)
  157. implicit none
  158. integer, intent (in) :: status
  159. !if(associated(Scr3Ptr)) call Scr3Ptr(status)
  160. !if(status == Clear_StatusType) print*,'On_Scr3_Clear'
  161. !if(status == Executed_StatusType) print*,'On_Scr3_Execute'
  162. endsubroutine
  163. subroutine ChangeScr4(status)
  164. implicit none
  165. integer, intent (in) :: status
  166. !if(associated(Scr4Ptr)) call Scr4Ptr(status)
  167. !if(status == Clear_StatusType) print*,'On_Scr4_Clear'
  168. !if(status == Executed_StatusType) print*,'On_Scr4_Execute'
  169. endsubroutine
  170. ! subroutine SubscribeRigAlarm(v)
  171. ! !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeRigAlarm
  172. ! !DEC$ ATTRIBUTES ALIAS: 'SubscribeRigAlarm' :: SubscribeRigAlarm
  173. ! implicit none
  174. ! procedure (ActionInteger) :: v
  175. ! RigAlarmPtr => v
  176. ! end subroutine
  177. ! subroutine SubscribeRigWaterSupply(v)
  178. ! !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeRigWaterSupply
  179. ! !DEC$ ATTRIBUTES ALIAS: 'SubscribeRigWaterSupply' :: SubscribeRigWaterSupply
  180. ! implicit none
  181. ! procedure (ActionInteger) :: v
  182. ! RigWaterSupplyPtr => v
  183. ! end subroutine
  184. ! subroutine SubscribeRigAir(v)
  185. ! !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeRigAir
  186. ! !DEC$ ATTRIBUTES ALIAS: 'SubscribeRigAir' :: SubscribeRigAir
  187. ! implicit none
  188. ! procedure (ActionInteger) :: v
  189. ! RigAirPtr => v
  190. ! end subroutine
  191. ! subroutine SubscribeGen1(v)
  192. ! !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeGen1
  193. ! !DEC$ ATTRIBUTES ALIAS: 'SubscribeGen1' :: SubscribeGen1
  194. ! implicit none
  195. ! procedure (ActionInteger) :: v
  196. ! Gen1Ptr => v
  197. ! end subroutine
  198. ! subroutine SubscribeGen2(v)
  199. ! !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeGen2
  200. ! !DEC$ ATTRIBUTES ALIAS: 'SubscribeGen2' :: SubscribeGen2
  201. ! implicit none
  202. ! procedure (ActionInteger) :: v
  203. ! Gen2Ptr => v
  204. ! end subroutine
  205. ! subroutine SubscribeGen3(v)
  206. ! !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeGen3
  207. ! !DEC$ ATTRIBUTES ALIAS: 'SubscribeGen3' :: SubscribeGen3
  208. ! implicit none
  209. ! procedure (ActionInteger) :: v
  210. ! Gen3Ptr => v
  211. ! end subroutine
  212. ! subroutine SubscribeGen4(v)
  213. ! !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeGen4
  214. ! !DEC$ ATTRIBUTES ALIAS: 'SubscribeGen4' :: SubscribeGen4
  215. ! implicit none
  216. ! procedure (ActionInteger) :: v
  217. ! Gen4Ptr => v
  218. ! end subroutine
  219. ! subroutine SubscribeScr1(v)
  220. ! !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeScr1
  221. ! !DEC$ ATTRIBUTES ALIAS: 'SubscribeScr1' :: SubscribeScr1
  222. ! implicit none
  223. ! procedure (ActionInteger) :: v
  224. ! Scr1Ptr => v
  225. ! end subroutine
  226. ! subroutine SubscribeScr2(v)
  227. ! !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeScr2
  228. ! !DEC$ ATTRIBUTES ALIAS: 'SubscribeScr2' :: SubscribeScr2
  229. ! implicit none
  230. ! procedure (ActionInteger) :: v
  231. ! Scr2Ptr => v
  232. ! end subroutine
  233. ! subroutine SubscribeScr3(v)
  234. ! !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeScr3
  235. ! !DEC$ ATTRIBUTES ALIAS: 'SubscribeScr3' :: SubscribeScr3
  236. ! implicit none
  237. ! procedure (ActionInteger) :: v
  238. ! Scr3Ptr => v
  239. ! end subroutine
  240. ! subroutine SubscribeScr4(v)
  241. ! !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeScr4
  242. ! !DEC$ ATTRIBUTES ALIAS: 'SubscribeScr4' :: SubscribeScr4
  243. ! implicit none
  244. ! procedure (ActionInteger) :: v
  245. ! Scr4Ptr => v
  246. ! end subroutine
  247. end module COtherProblemsVariables