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.
 
 
 
 
 
 

216 lines
14 KiB

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