Simulation Core
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

COtherProblemsVariables.f90 12 KiB

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