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.
 
 
 
 
 
 

195 line
13 KiB

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