Simulation Core
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

1 год назад
1 год назад
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. module COtherProblems
  2. use SimulationVariables
  3. implicit none
  4. public
  5. contains
  6. subroutine OtherProblemsFromJson(parent)
  7. type(json_value),pointer :: parent
  8. type(json_core) :: json
  9. type(json_value),pointer :: p
  10. call json%get(parent,'OtherProblems',p)
  11. call ProblemFromJson(p,"RigAlarm",data%problems%OtherProblems%RigAlarm)
  12. call ProblemFromJson(p,"RigWaterSupply",data%problems%OtherProblems%RigWaterSupply)
  13. call ProblemFromJson(p,"RigAir",data%problems%OtherProblems%RigAir)
  14. call ProblemFromJson(p,"Gen1",data%problems%OtherProblems%Gen1)
  15. call ProblemFromJson(p,"Gen2",data%problems%OtherProblems%Gen2)
  16. call ProblemFromJson(p,"Gen3",data%problems%OtherProblems%Gen3)
  17. call ProblemFromJson(p,"Gen4",data%problems%OtherProblems%Gen4)
  18. call ProblemFromJson(p,"Scr1",data%problems%OtherProblems%Scr1)
  19. call ProblemFromJson(p,"Scr2",data%problems%OtherProblems%Scr2)
  20. call ProblemFromJson(p,"Scr3",data%problems%OtherProblems%Scr3)
  21. call ProblemFromJson(p,"Scr4",data%problems%OtherProblems%Scr4)
  22. end subroutine
  23. subroutine OtherProblemsToJson(parent)
  24. type(json_value),pointer :: parent
  25. type(json_core) :: json
  26. type(json_value),pointer :: p
  27. ! 1. create new node
  28. call json%create_object(p,'OtherProblems')
  29. ! 2. add member of data type to new node
  30. call ProblemToJson(p,"RigAlarm",data%problems%OtherProblems%RigAlarm)
  31. call ProblemToJson(p,"RigWaterSupply",data%problems%OtherProblems%RigWaterSupply)
  32. call ProblemToJson(p,"RigAir",data%problems%OtherProblems%RigAir)
  33. call ProblemToJson(p,"Gen1",data%problems%OtherProblems%Gen1)
  34. call ProblemToJson(p,"Gen2",data%problems%OtherProblems%Gen2)
  35. call ProblemToJson(p,"Gen3",data%problems%OtherProblems%Gen3)
  36. call ProblemToJson(p,"Gen4",data%problems%OtherProblems%Gen4)
  37. call ProblemToJson(p,"Scr1",data%problems%OtherProblems%Scr1)
  38. call ProblemToJson(p,"Scr2",data%problems%OtherProblems%Scr2)
  39. call ProblemToJson(p,"Scr3",data%problems%OtherProblems%Scr3)
  40. call ProblemToJson(p,"Scr4",data%problems%OtherProblems%Scr4)
  41. ! 3. add new node to parent
  42. call json%add(parent,p)
  43. end subroutine
  44. subroutine ProcessOtherProblemsDueTime(time)
  45. implicit none
  46. integer :: time
  47. if(data%problems%OtherProblems%RigAlarm%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%OtherProblems%RigAlarm, ChangeRigAlarm, time)
  48. if(data%problems%OtherProblems%RigWaterSupply%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%OtherProblems%RigWaterSupply, ChangeRigWaterSupply, time)
  49. if(data%problems%OtherProblems%RigAir%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%OtherProblems%RigAir, ChangeRigAir, time)
  50. if(data%problems%OtherProblems%Gen1%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%OtherProblems%Gen1, ChangeGen1, time)
  51. if(data%problems%OtherProblems%Gen2%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%OtherProblems%Gen2, ChangeGen2, time)
  52. if(data%problems%OtherProblems%Gen3%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%OtherProblems%Gen3, ChangeGen3, time)
  53. if(data%problems%OtherProblems%Gen4%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%OtherProblems%Gen4, ChangeGen4, time)
  54. if(data%problems%OtherProblems%Scr1%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%OtherProblems%Scr1, ChangeScr1, time)
  55. if(data%problems%OtherProblems%Scr2%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%OtherProblems%Scr2, ChangeScr2, time)
  56. if(data%problems%OtherProblems%Scr3%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%OtherProblems%Scr3, ChangeScr3, time)
  57. if(data%problems%OtherProblems%Scr4%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%OtherProblems%Scr4, ChangeScr4, time)
  58. end subroutine
  59. subroutine ProcessOtherProblemsDuePumpStrokes(strokes)
  60. implicit none
  61. integer :: strokes
  62. if(data%problems%OtherProblems%RigAlarm%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%OtherProblems%RigAlarm, ChangeRigAlarm, strokes)
  63. if(data%problems%OtherProblems%RigWaterSupply%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%OtherProblems%RigWaterSupply, ChangeRigWaterSupply, strokes)
  64. if(data%problems%OtherProblems%RigAir%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%OtherProblems%RigAir, ChangeRigAir, strokes)
  65. if(data%problems%OtherProblems%Gen1%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%OtherProblems%Gen1, ChangeGen1, strokes)
  66. if(data%problems%OtherProblems%Gen2%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%OtherProblems%Gen2, ChangeGen2, strokes)
  67. if(data%problems%OtherProblems%Gen3%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%OtherProblems%Gen3, ChangeGen3, strokes)
  68. if(data%problems%OtherProblems%Gen4%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%OtherProblems%Gen4, ChangeGen4, strokes)
  69. if(data%problems%OtherProblems%Scr1%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%OtherProblems%Scr1, ChangeScr1, strokes)
  70. if(data%problems%OtherProblems%Scr2%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%OtherProblems%Scr2, ChangeScr2, strokes)
  71. if(data%problems%OtherProblems%Scr3%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%OtherProblems%Scr3, ChangeScr3, strokes)
  72. if(data%problems%OtherProblems%Scr4%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%OtherProblems%Scr4, ChangeScr4, strokes)
  73. end subroutine
  74. subroutine ProcessOtherProblemsDueVolumePumped(volume)
  75. implicit none
  76. real(8) :: volume
  77. if(data%problems%OtherProblems%RigAlarm%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%OtherProblems%RigAlarm, ChangeRigAlarm, volume)
  78. if(data%problems%OtherProblems%RigWaterSupply%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%OtherProblems%RigWaterSupply, ChangeRigWaterSupply, volume)
  79. if(data%problems%OtherProblems%RigAir%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%OtherProblems%RigAir, ChangeRigAir, volume)
  80. if(data%problems%OtherProblems%Gen1%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%OtherProblems%Gen1, ChangeGen1, volume)
  81. if(data%problems%OtherProblems%Gen2%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%OtherProblems%Gen2, ChangeGen2, volume)
  82. if(data%problems%OtherProblems%Gen3%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%OtherProblems%Gen3, ChangeGen3, volume)
  83. if(data%problems%OtherProblems%Gen4%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%OtherProblems%Gen4, ChangeGen4, volume)
  84. if(data%problems%OtherProblems%Scr1%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%OtherProblems%Scr1, ChangeScr1, volume)
  85. if(data%problems%OtherProblems%Scr2%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%OtherProblems%Scr2, ChangeScr2, volume)
  86. if(data%problems%OtherProblems%Scr3%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%OtherProblems%Scr3, ChangeScr3, volume)
  87. if(data%problems%OtherProblems%Scr4%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%OtherProblems%Scr4, ChangeScr4, volume)
  88. end subroutine
  89. subroutine ProcessOtherProblemsDueDistanceDrilled(distance)
  90. implicit none
  91. real(8) :: distance
  92. if(data%problems%OtherProblems%RigAlarm%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%OtherProblems%RigAlarm, ChangeRigAlarm, distance)
  93. if(data%problems%OtherProblems%RigWaterSupply%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%OtherProblems%RigWaterSupply, ChangeRigWaterSupply, distance)
  94. if(data%problems%OtherProblems%RigAir%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%OtherProblems%RigAir, ChangeRigAir, distance)
  95. if(data%problems%OtherProblems%Gen1%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%OtherProblems%Gen1, ChangeGen1, distance)
  96. if(data%problems%OtherProblems%Gen2%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%OtherProblems%Gen2, ChangeGen2, distance)
  97. if(data%problems%OtherProblems%Gen3%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%OtherProblems%Gen3, ChangeGen3, distance)
  98. if(data%problems%OtherProblems%Gen4%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%OtherProblems%Gen4, ChangeGen4, distance)
  99. if(data%problems%OtherProblems%Scr1%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%OtherProblems%Scr1, ChangeScr1, distance)
  100. if(data%problems%OtherProblems%Scr2%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%OtherProblems%Scr2, ChangeScr2, distance)
  101. if(data%problems%OtherProblems%Scr3%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%OtherProblems%Scr3, ChangeScr3, distance)
  102. if(data%problems%OtherProblems%Scr4%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%OtherProblems%Scr4, ChangeScr4, distance)
  103. end subroutine
  104. subroutine ChangeRigAlarm(status)
  105. implicit none
  106. integer, intent (in) :: status
  107. !if(associated(RigAlarmPtr)) call RigAlarmPtr(status)
  108. !if(status == Clear_StatusType) if(print_log) print*,'On_RigAlarm_Clear'
  109. !if(status == Executed_StatusType) if(print_log) print*,'On_RigAlarm_Execute'
  110. endsubroutine
  111. subroutine ChangeRigWaterSupply(status)
  112. implicit none
  113. integer, intent (in) :: status
  114. !if(associated(RigWaterSupplyPtr)) call RigWaterSupplyPtr(status)
  115. !if(status == Clear_StatusType) if(print_log) print*,'On_RigWaterSupply_Clear'
  116. !if(status == Executed_StatusType) if(print_log) print*,'On_RigWaterSupply_Execute'
  117. endsubroutine
  118. subroutine ChangeRigAir(status)
  119. use SimulationVariables
  120. implicit none
  121. integer, intent (in) :: status
  122. !if(associated(RigAirPtr)) call RigAirPtr(status)
  123. if(status == Clear_StatusType) data%State%BopStackAcc%RigAirMalf = 0
  124. if(status == Executed_StatusType) data%State%BopStackAcc%RigAirMalf = 1
  125. endsubroutine
  126. subroutine ChangeGen1(status)
  127. implicit none
  128. integer, intent (in) :: status
  129. !if(associated(Gen1Ptr)) call Gen1Ptr(status)
  130. !if(status == Clear_StatusType) if(print_log) print*,'On_Gen1_Clear'
  131. !if(status == Executed_StatusType) if(print_log) print*,'On_Gen1_Execute'
  132. endsubroutine
  133. subroutine ChangeGen2(status)
  134. implicit none
  135. integer, intent (in) :: status
  136. !if(associated(Gen2Ptr)) call Gen2Ptr(status)
  137. !if(status == Clear_StatusType) if(print_log) print*,'On_Gen2_Clear'
  138. !if(status == Executed_StatusType) if(print_log) print*,'On_Gen2_Execute'
  139. endsubroutine
  140. subroutine ChangeGen3(status)
  141. implicit none
  142. integer, intent (in) :: status
  143. !if(associated(Gen3Ptr)) call Gen3Ptr(status)
  144. !if(status == Clear_StatusType) if(print_log) print*,'On_Gen3_Clear'
  145. !if(status == Executed_StatusType) if(print_log) print*,'On_Gen3_Execute'
  146. endsubroutine
  147. subroutine ChangeGen4(status)
  148. implicit none
  149. integer, intent (in) :: status
  150. !if(associated(Gen4Ptr)) call Gen4Ptr(status)
  151. !if(status == Clear_StatusType) if(print_log) print*,'On_Gen4_Clear'
  152. !if(status == Executed_StatusType) if(print_log) print*,'On_Gen4_Execute'
  153. endsubroutine
  154. subroutine ChangeScr1(status)
  155. implicit none
  156. integer, intent (in) :: status
  157. !if(associated(Scr1Ptr)) call Scr1Ptr(status)
  158. !if(status == Clear_StatusType) if(print_log) print*,'On_Scr1_Clear'
  159. !if(status == Executed_StatusType) if(print_log) print*,'On_Scr1_Execute'
  160. endsubroutine
  161. subroutine ChangeScr2(status)
  162. implicit none
  163. integer, intent (in) :: status
  164. !if(associated(Scr2Ptr)) call Scr2Ptr(status)
  165. !if(status == Clear_StatusType) if(print_log) print*,'On_Scr2_Clear'
  166. !if(status == Executed_StatusType) if(print_log) print*,'On_Scr2_Execute'
  167. endsubroutine
  168. subroutine ChangeScr3(status)
  169. implicit none
  170. integer, intent (in) :: status
  171. !if(associated(Scr3Ptr)) call Scr3Ptr(status)
  172. !if(status == Clear_StatusType) if(print_log) print*,'On_Scr3_Clear'
  173. !if(status == Executed_StatusType) if(print_log) print*,'On_Scr3_Execute'
  174. endsubroutine
  175. subroutine ChangeScr4(status)
  176. implicit none
  177. integer, intent (in) :: status
  178. !if(associated(Scr4Ptr)) call Scr4Ptr(status)
  179. !if(status == Clear_StatusType) if(print_log) print*,'On_Scr4_Clear'
  180. !if(status == Executed_StatusType) if(print_log) print*,'On_Scr4_Execute'
  181. endsubroutine
  182. end module COtherProblems