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.
 
 
 
 
 
 

407 lines
32 KiB

  1. module CGaugesProblems
  2. use SimulationVariables
  3. implicit none
  4. public
  5. contains
  6. subroutine GaugesProblemsFromJson(parent)
  7. type(json_value),pointer :: parent
  8. type(json_core) :: json
  9. type(json_value),pointer :: p
  10. call json%get(parent,'GaugesProblems',p)
  11. call ProblemFromJson(p,"WeightIndicator",data%problems%GaugesProblems%WeightIndicator)
  12. call ProblemFromJson(p,"RotaryRpm",data%problems%GaugesProblems%RotaryRpm)
  13. call ProblemFromJson(p,"RotaryTorque",data%problems%GaugesProblems%RotaryTorque)
  14. call ProblemFromJson(p,"StandPipePressure",data%problems%GaugesProblems%StandPipePressure)
  15. call ProblemFromJson(p,"CasingPressure",data%problems%GaugesProblems%CasingPressure)
  16. call ProblemFromJson(p,"Pump1Strokes",data%problems%GaugesProblems%Pump1Strokes)
  17. call ProblemFromJson(p,"Pump2Strokes",data%problems%GaugesProblems%Pump2Strokes)
  18. call ProblemFromJson(p,"ReturnLineTemperature",data%problems%GaugesProblems%ReturnLineTemperature)
  19. call ProblemFromJson(p,"TripTank",data%problems%GaugesProblems%TripTank)
  20. call ProblemFromJson(p,"PitGainLoss",data%problems%GaugesProblems%PitGainLoss)
  21. call ProblemFromJson(p,"MudTankVolume",data%problems%GaugesProblems%MudTankVolume)
  22. call ProblemFromJson(p,"ReturnMudFlow",data%problems%GaugesProblems%ReturnMudFlow)
  23. call ProblemFromJson(p,"TorqueLimit",data%problems%GaugesProblems%TorqueLimit)
  24. call ProblemFromJson(p,"PowerLimit",data%problems%GaugesProblems%PowerLimit)
  25. call ProblemFromJson(p,"AccumulatorPressure",data%problems%GaugesProblems%AccumulatorPressure)
  26. call ProblemFromJson(p,"ManifoldPressure",data%problems%GaugesProblems%ManifoldPressure)
  27. call ProblemFromJson(p,"AnnularPressure",data%problems%GaugesProblems%AnnularPressure)
  28. call ProblemFromJson(p,"RigAirPressure",data%problems%GaugesProblems%RigAirPressure)
  29. call ProblemFromJson(p,"StandPipe1",data%problems%GaugesProblems%StandPipe1)
  30. call ProblemFromJson(p,"StandPipe2",data%problems%GaugesProblems%StandPipe2)
  31. call ProblemFromJson(p,"DrillPipePressure",data%problems%GaugesProblems%DrillPipePressure)
  32. call ProblemFromJson(p,"ChokePosition",data%problems%GaugesProblems%ChokePosition)
  33. call ProblemFromJson(p,"CasingPressure2",data%problems%GaugesProblems%CasingPressure2)
  34. end subroutine
  35. subroutine GaugesProblemsToJson(parent)
  36. type(json_value),pointer :: parent
  37. type(json_core) :: json
  38. type(json_value),pointer :: p
  39. ! 1. create new node
  40. call json%create_object(p,'GaugesProblems')
  41. ! 2. add member of data type to new node
  42. call ProblemToJson(p,"WeightIndicator",data%problems%GaugesProblems%WeightIndicator)
  43. call ProblemToJson(p,"RotaryRpm",data%problems%GaugesProblems%RotaryRpm)
  44. call ProblemToJson(p,"RotaryTorque",data%problems%GaugesProblems%RotaryTorque)
  45. call ProblemToJson(p,"StandPipePressure",data%problems%GaugesProblems%StandPipePressure)
  46. call ProblemToJson(p,"CasingPressure",data%problems%GaugesProblems%CasingPressure)
  47. call ProblemToJson(p,"Pump1Strokes",data%problems%GaugesProblems%Pump1Strokes)
  48. call ProblemToJson(p,"Pump2Strokes",data%problems%GaugesProblems%Pump2Strokes)
  49. call ProblemToJson(p,"ReturnLineTemperature",data%problems%GaugesProblems%ReturnLineTemperature)
  50. call ProblemToJson(p,"TripTank",data%problems%GaugesProblems%TripTank)
  51. call ProblemToJson(p,"PitGainLoss",data%problems%GaugesProblems%PitGainLoss)
  52. call ProblemToJson(p,"MudTankVolume",data%problems%GaugesProblems%MudTankVolume)
  53. call ProblemToJson(p,"ReturnMudFlow",data%problems%GaugesProblems%ReturnMudFlow)
  54. call ProblemToJson(p,"TorqueLimit",data%problems%GaugesProblems%TorqueLimit)
  55. call ProblemToJson(p,"PowerLimit",data%problems%GaugesProblems%PowerLimit)
  56. call ProblemToJson(p,"AccumulatorPressure",data%problems%GaugesProblems%AccumulatorPressure)
  57. call ProblemToJson(p,"ManifoldPressure",data%problems%GaugesProblems%ManifoldPressure)
  58. call ProblemToJson(p,"AnnularPressure",data%problems%GaugesProblems%AnnularPressure)
  59. call ProblemToJson(p,"RigAirPressure",data%problems%GaugesProblems%RigAirPressure)
  60. call ProblemToJson(p,"StandPipe1",data%problems%GaugesProblems%StandPipe1)
  61. call ProblemToJson(p,"StandPipe2",data%problems%GaugesProblems%StandPipe2)
  62. call ProblemToJson(p,"DrillPipePressure",data%problems%GaugesProblems%DrillPipePressure)
  63. call ProblemToJson(p,"ChokePosition",data%problems%GaugesProblems%ChokePosition)
  64. call ProblemToJson(p,"CasingPressure2",data%problems%GaugesProblems%CasingPressure2)
  65. ! 3. add new node to parent
  66. call json%add(parent,p)
  67. end subroutine
  68. subroutine ProcessGaugesProblemsDueTime(time)
  69. implicit none
  70. integer :: time
  71. if(data%problems%GaugesProblems%WeightIndicator%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%GaugesProblems%WeightIndicator, ChangeWeightIndicator, time)
  72. if(data%problems%GaugesProblems%RotaryRpm%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%GaugesProblems%RotaryRpm, ChangeRotaryRpm, time)
  73. if(data%problems%GaugesProblems%RotaryTorque%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%GaugesProblems%RotaryTorque, ChangeRotaryTorque, time)
  74. if(data%problems%GaugesProblems%StandPipePressure%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%GaugesProblems%StandPipePressure, ChangeStandPipePressure, time)
  75. if(data%problems%GaugesProblems%CasingPressure%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%GaugesProblems%CasingPressure, ChangeCasingPressure, time)
  76. if(data%problems%GaugesProblems%Pump1Strokes%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%GaugesProblems%Pump1Strokes, ChangePump1Strokes, time)
  77. if(data%problems%GaugesProblems%Pump2Strokes%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%GaugesProblems%Pump2Strokes, ChangePump2Strokes, time)
  78. if(data%problems%GaugesProblems%ReturnLineTemperature%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%GaugesProblems%ReturnLineTemperature, ChangeReturnLineTemperature, time)
  79. if(data%problems%GaugesProblems%TripTank%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%GaugesProblems%TripTank, ChangeTripTank, time)
  80. if(data%problems%GaugesProblems%PitGainLoss%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%GaugesProblems%PitGainLoss, ChangePitGainLoss, time)
  81. if(data%problems%GaugesProblems%MudTankVolume%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%GaugesProblems%MudTankVolume, ChangeMudTankVolume, time)
  82. if(data%problems%GaugesProblems%ReturnMudFlow%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%GaugesProblems%ReturnMudFlow, ChangeReturnMudFlow, time)
  83. if(data%problems%GaugesProblems%TorqueLimit%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%GaugesProblems%TorqueLimit, ChangeTorqueLimit, time)
  84. if(data%problems%GaugesProblems%PowerLimit%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%GaugesProblems%PowerLimit, ChangePowerLimit, time)
  85. if(data%problems%GaugesProblems%AccumulatorPressure%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%GaugesProblems%AccumulatorPressure, ChangeAccumulatorPressure, time)
  86. if(data%problems%GaugesProblems%ManifoldPressure%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%GaugesProblems%ManifoldPressure, ChangeManifoldPressure, time)
  87. if(data%problems%GaugesProblems%AnnularPressure%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%GaugesProblems%AnnularPressure, ChangeAnnularPressure, time)
  88. if(data%problems%GaugesProblems%RigAirPressure%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%GaugesProblems%RigAirPressure, ChangeRigAirPressure, time)
  89. if(data%problems%GaugesProblems%StandPipe1%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%GaugesProblems%StandPipe1, ChangeStandPipe1, time)
  90. if(data%problems%GaugesProblems%StandPipe2%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%GaugesProblems%StandPipe2, ChangeStandPipe2, time)
  91. if(data%problems%GaugesProblems%DrillPipePressure%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%GaugesProblems%DrillPipePressure, ChangeDrillPipePressure, time)
  92. if(data%problems%GaugesProblems%ChokePosition%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%GaugesProblems%ChokePosition, ChangeChokePosition, time)
  93. if(data%problems%GaugesProblems%CasingPressure2%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%GaugesProblems%CasingPressure2, ChangeCasingPressure2, time)
  94. end subroutine
  95. subroutine ProcessGaugesProblemsDuePumpStrokes(strokes)
  96. implicit none
  97. integer :: strokes
  98. if(data%problems%GaugesProblems%WeightIndicator%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%GaugesProblems%WeightIndicator, ChangeWeightIndicator, strokes)
  99. if(data%problems%GaugesProblems%RotaryRpm%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%GaugesProblems%RotaryRpm, ChangeRotaryRpm, strokes)
  100. if(data%problems%GaugesProblems%RotaryTorque%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%GaugesProblems%RotaryTorque, ChangeRotaryTorque, strokes)
  101. if(data%problems%GaugesProblems%StandPipePressure%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%GaugesProblems%StandPipePressure, ChangeStandPipePressure, strokes)
  102. if(data%problems%GaugesProblems%CasingPressure%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%GaugesProblems%CasingPressure, ChangeCasingPressure, strokes)
  103. if(data%problems%GaugesProblems%Pump1Strokes%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%GaugesProblems%Pump1Strokes, ChangePump1Strokes, strokes)
  104. if(data%problems%GaugesProblems%Pump2Strokes%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%GaugesProblems%Pump2Strokes, ChangePump2Strokes, strokes)
  105. if(data%problems%GaugesProblems%ReturnLineTemperature%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%GaugesProblems%ReturnLineTemperature, ChangeReturnLineTemperature, strokes)
  106. if(data%problems%GaugesProblems%TripTank%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%GaugesProblems%TripTank, ChangeTripTank, strokes)
  107. if(data%problems%GaugesProblems%PitGainLoss%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%GaugesProblems%PitGainLoss, ChangePitGainLoss, strokes)
  108. if(data%problems%GaugesProblems%MudTankVolume%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%GaugesProblems%MudTankVolume, ChangeMudTankVolume, strokes)
  109. if(data%problems%GaugesProblems%ReturnMudFlow%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%GaugesProblems%ReturnMudFlow, ChangeReturnMudFlow, strokes)
  110. if(data%problems%GaugesProblems%TorqueLimit%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%GaugesProblems%TorqueLimit, ChangeTorqueLimit, strokes)
  111. if(data%problems%GaugesProblems%PowerLimit%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%GaugesProblems%PowerLimit, ChangePowerLimit, strokes)
  112. if(data%problems%GaugesProblems%AccumulatorPressure%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%GaugesProblems%AccumulatorPressure, ChangeAccumulatorPressure, strokes)
  113. if(data%problems%GaugesProblems%ManifoldPressure%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%GaugesProblems%ManifoldPressure, ChangeManifoldPressure, strokes)
  114. if(data%problems%GaugesProblems%AnnularPressure%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%GaugesProblems%AnnularPressure, ChangeAnnularPressure, strokes)
  115. if(data%problems%GaugesProblems%RigAirPressure%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%GaugesProblems%RigAirPressure, ChangeRigAirPressure, strokes)
  116. if(data%problems%GaugesProblems%StandPipe1%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%GaugesProblems%StandPipe1, ChangeStandPipe1, strokes)
  117. if(data%problems%GaugesProblems%StandPipe2%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%GaugesProblems%StandPipe2, ChangeStandPipe2, strokes)
  118. if(data%problems%GaugesProblems%DrillPipePressure%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%GaugesProblems%DrillPipePressure, ChangeDrillPipePressure, strokes)
  119. if(data%problems%GaugesProblems%ChokePosition%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%GaugesProblems%ChokePosition, ChangeChokePosition, strokes)
  120. if(data%problems%GaugesProblems%CasingPressure2%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%GaugesProblems%CasingPressure2, ChangeCasingPressure2, strokes)
  121. end subroutine
  122. subroutine ProcessGaugesProblemsDueVolumePumped(volume)
  123. implicit none
  124. real(8) :: volume
  125. if(data%problems%GaugesProblems%WeightIndicator%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%GaugesProblems%WeightIndicator, ChangeWeightIndicator, volume)
  126. if(data%problems%GaugesProblems%RotaryRpm%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%GaugesProblems%RotaryRpm, ChangeRotaryRpm, volume)
  127. if(data%problems%GaugesProblems%RotaryTorque%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%GaugesProblems%RotaryTorque, ChangeRotaryTorque, volume)
  128. if(data%problems%GaugesProblems%StandPipePressure%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%GaugesProblems%StandPipePressure, ChangeStandPipePressure, volume)
  129. if(data%problems%GaugesProblems%CasingPressure%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%GaugesProblems%CasingPressure, ChangeCasingPressure, volume)
  130. if(data%problems%GaugesProblems%Pump1Strokes%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%GaugesProblems%Pump1Strokes, ChangePump1Strokes, volume)
  131. if(data%problems%GaugesProblems%Pump2Strokes%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%GaugesProblems%Pump2Strokes, ChangePump2Strokes, volume)
  132. if(data%problems%GaugesProblems%ReturnLineTemperature%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%GaugesProblems%ReturnLineTemperature, ChangeReturnLineTemperature, volume)
  133. if(data%problems%GaugesProblems%TripTank%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%GaugesProblems%TripTank, ChangeTripTank, volume)
  134. if(data%problems%GaugesProblems%PitGainLoss%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%GaugesProblems%PitGainLoss, ChangePitGainLoss, volume)
  135. if(data%problems%GaugesProblems%MudTankVolume%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%GaugesProblems%MudTankVolume, ChangeMudTankVolume, volume)
  136. if(data%problems%GaugesProblems%ReturnMudFlow%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%GaugesProblems%ReturnMudFlow, ChangeReturnMudFlow, volume)
  137. if(data%problems%GaugesProblems%TorqueLimit%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%GaugesProblems%TorqueLimit, ChangeTorqueLimit, volume)
  138. if(data%problems%GaugesProblems%PowerLimit%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%GaugesProblems%PowerLimit, ChangePowerLimit, volume)
  139. if(data%problems%GaugesProblems%AccumulatorPressure%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%GaugesProblems%AccumulatorPressure, ChangeAccumulatorPressure, volume)
  140. if(data%problems%GaugesProblems%ManifoldPressure%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%GaugesProblems%ManifoldPressure, ChangeManifoldPressure, volume)
  141. if(data%problems%GaugesProblems%AnnularPressure%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%GaugesProblems%AnnularPressure, ChangeAnnularPressure, volume)
  142. if(data%problems%GaugesProblems%RigAirPressure%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%GaugesProblems%RigAirPressure, ChangeRigAirPressure, volume)
  143. if(data%problems%GaugesProblems%StandPipe1%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%GaugesProblems%StandPipe1, ChangeStandPipe1, volume)
  144. if(data%problems%GaugesProblems%StandPipe2%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%GaugesProblems%StandPipe2, ChangeStandPipe2, volume)
  145. if(data%problems%GaugesProblems%DrillPipePressure%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%GaugesProblems%DrillPipePressure, ChangeDrillPipePressure, volume)
  146. if(data%problems%GaugesProblems%ChokePosition%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%GaugesProblems%ChokePosition, ChangeChokePosition, volume)
  147. if(data%problems%GaugesProblems%CasingPressure2%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%GaugesProblems%CasingPressure2, ChangeCasingPressure2, volume)
  148. end subroutine
  149. subroutine ProcessGaugesProblemsDueDistanceDrilled(distance)
  150. implicit none
  151. real(8) :: distance
  152. if(data%problems%GaugesProblems%WeightIndicator%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%GaugesProblems%WeightIndicator, ChangeWeightIndicator, distance)
  153. if(data%problems%GaugesProblems%RotaryRpm%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%GaugesProblems%RotaryRpm, ChangeRotaryRpm, distance)
  154. if(data%problems%GaugesProblems%RotaryTorque%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%GaugesProblems%RotaryTorque, ChangeRotaryTorque, distance)
  155. if(data%problems%GaugesProblems%StandPipePressure%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%GaugesProblems%StandPipePressure, ChangeStandPipePressure, distance)
  156. if(data%problems%GaugesProblems%CasingPressure%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%GaugesProblems%CasingPressure, ChangeCasingPressure, distance)
  157. if(data%problems%GaugesProblems%Pump1Strokes%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%GaugesProblems%Pump1Strokes, ChangePump1Strokes, distance)
  158. if(data%problems%GaugesProblems%Pump2Strokes%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%GaugesProblems%Pump2Strokes, ChangePump2Strokes, distance)
  159. if(data%problems%GaugesProblems%ReturnLineTemperature%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%GaugesProblems%ReturnLineTemperature, ChangeReturnLineTemperature, distance)
  160. if(data%problems%GaugesProblems%TripTank%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%GaugesProblems%TripTank, ChangeTripTank, distance)
  161. if(data%problems%GaugesProblems%PitGainLoss%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%GaugesProblems%PitGainLoss, ChangePitGainLoss, distance)
  162. if(data%problems%GaugesProblems%MudTankVolume%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%GaugesProblems%MudTankVolume, ChangeMudTankVolume, distance)
  163. if(data%problems%GaugesProblems%ReturnMudFlow%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%GaugesProblems%ReturnMudFlow, ChangeReturnMudFlow, distance)
  164. if(data%problems%GaugesProblems%TorqueLimit%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%GaugesProblems%TorqueLimit, ChangeTorqueLimit, distance)
  165. if(data%problems%GaugesProblems%PowerLimit%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%GaugesProblems%PowerLimit, ChangePowerLimit, distance)
  166. if(data%problems%GaugesProblems%AccumulatorPressure%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%GaugesProblems%AccumulatorPressure, ChangeAccumulatorPressure, distance)
  167. if(data%problems%GaugesProblems%ManifoldPressure%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%GaugesProblems%ManifoldPressure, ChangeManifoldPressure, distance)
  168. if(data%problems%GaugesProblems%AnnularPressure%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%GaugesProblems%AnnularPressure, ChangeAnnularPressure, distance)
  169. if(data%problems%GaugesProblems%RigAirPressure%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%GaugesProblems%RigAirPressure, ChangeRigAirPressure, distance)
  170. if(data%problems%GaugesProblems%StandPipe1%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%GaugesProblems%StandPipe1, ChangeStandPipe1, distance)
  171. if(data%problems%GaugesProblems%StandPipe2%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%GaugesProblems%StandPipe2, ChangeStandPipe2, distance)
  172. if(data%problems%GaugesProblems%DrillPipePressure%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%GaugesProblems%DrillPipePressure, ChangeDrillPipePressure, distance)
  173. if(data%problems%GaugesProblems%ChokePosition%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%GaugesProblems%ChokePosition, ChangeChokePosition, distance)
  174. if(data%problems%GaugesProblems%CasingPressure2%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%GaugesProblems%CasingPressure2, ChangeCasingPressure2, distance)
  175. end subroutine
  176. subroutine ChangeWeightIndicator(status)
  177. use SimulationVariables !@
  178. implicit none
  179. integer, intent (in) :: status
  180. ! if(associated(WeightIndicatorPtr)) call WeightIndicatorPtr(status)
  181. if(status == Clear_StatusType) data%State%TD_General%WeightIndicatorMalf = 0
  182. if(status == Executed_StatusType) data%State%TD_General%WeightIndicatorMalf = 1
  183. endsubroutine
  184. subroutine ChangeRotaryRpm(status)
  185. use SimulationVariables !@
  186. implicit none
  187. integer, intent (in) :: status
  188. ! if(associated(RotaryRpmPtr)) call RotaryRpmPtr(status)
  189. if(status == Clear_StatusType) data%State%RTable%RpmGaugeMalf = 0
  190. if(status == Executed_StatusType) data%State%RTable%RpmGaugeMalf = 1
  191. endsubroutine
  192. subroutine ChangeRotaryTorque(status)
  193. use SimulationVariables !@
  194. implicit none
  195. integer, intent (in) :: status
  196. ! if(associated(RotaryTorquePtr)) call RotaryTorquePtr(status)
  197. if(status == Clear_StatusType) data%State%RTable%TorqueGaugeMalf = 0
  198. if(status == Executed_StatusType) data%State%RTable%TorqueGaugeMalf = 1
  199. endsubroutine
  200. subroutine ChangeStandPipePressure(status)
  201. USE MudSystemVARIABLES
  202. use SimulationVariables !@@@
  203. implicit none
  204. integer, intent (in) :: status
  205. ! if(associated(StandPipePressurePtr)) call StandPipePressurePtr(status)
  206. if(status == Clear_StatusType) data%State%MudSystem%StandPipePressure_DataDisplayMalf = 0
  207. if(status == Executed_StatusType) data%State%MudSystem%StandPipePressure_DataDisplayMalf = 1
  208. endsubroutine
  209. subroutine ChangeCasingPressure(status)
  210. USE FricPressDropVarsModule
  211. implicit none
  212. integer, intent (in) :: status
  213. ! if(associated(CasingPressurePtr)) call CasingPressurePtr(status)
  214. if(status == Clear_StatusType) data%State%FricPressDrop%CasingPressure_DataDisplayMalF = 0
  215. if(status == Executed_StatusType) data%State%FricPressDrop%CasingPressure_DataDisplayMalF = 1
  216. endsubroutine
  217. subroutine ChangePump1Strokes(status)
  218. use SimulationVariables
  219. implicit none
  220. integer, intent (in) :: status
  221. ! if(associated(Pump1StrokesPtr)) call Pump1StrokesPtr(status)
  222. if(status == Clear_StatusType) data%State%Pump(1)%SPMGaugeMalf = 0
  223. if(status == Executed_StatusType) data%State%Pump(1)%SPMGaugeMalf = 1
  224. endsubroutine
  225. subroutine ChangePump2Strokes(status)
  226. use SimulationVariables
  227. implicit none
  228. integer, intent (in) :: status
  229. ! if(associated(Pump2StrokesPtr)) call Pump2StrokesPtr(status)
  230. if(status == Clear_StatusType) data%State%Pump(2)%SPMGaugeMalf = 0
  231. if(status == Executed_StatusType) data%State%Pump(2)%SPMGaugeMalf = 1
  232. endsubroutine
  233. subroutine ChangeReturnLineTemperature(status)
  234. implicit none
  235. integer, intent (in) :: status
  236. ! if(associated(ReturnLineTemperaturePtr)) call ReturnLineTemperaturePtr(status)
  237. !if(status == Clear_StatusType) if(print_log) print*,'On_ReturnLineTemperature_Clear'
  238. !if(status == Executed_StatusType) if(print_log) print*,'On_ReturnLineTemperature_Execute'
  239. endsubroutine
  240. subroutine ChangeTripTank(status)
  241. USE MudSystemVARIABLES
  242. use SimulationVariables !@@@
  243. implicit none
  244. integer, intent (in) :: status
  245. ! if(associated(TripTankPtr)) call TripTankPtr(status)
  246. if(status == Clear_StatusType) data%State%MudSystem%TripTankPressure_DataDisplayMalf = 0
  247. if(status == Executed_StatusType) data%State%MudSystem%TripTankPressure_DataDisplayMalf = 1
  248. endsubroutine
  249. subroutine ChangePitGainLoss(status)
  250. USE MudSystemVARIABLES
  251. use SimulationVariables !@@@
  252. implicit none
  253. integer, intent (in) :: status
  254. ! if(associated(PitGainLossPtr)) call PitGainLossPtr(status)
  255. if(status == Clear_StatusType) data%State%MudSystem%PitGainLossGaugeMalf = 0
  256. if(status == Executed_StatusType) data%State%MudSystem%PitGainLossGaugeMalf = 1
  257. endsubroutine
  258. subroutine ChangeMudTankVolume(status)
  259. implicit none
  260. integer, intent (in) :: status
  261. ! if(associated(MudTankVolumePtr)) call MudTankVolumePtr(status)
  262. !if(status == Clear_StatusType) if(print_log) print*,'On_MudTankVolume_Clear'
  263. !if(status == Executed_StatusType) if(print_log) print*,'On_MudTankVolume_Execute'
  264. endsubroutine
  265. subroutine ChangeReturnMudFlow(status)
  266. implicit none
  267. integer, intent (in) :: status
  268. ! if(associated(ReturnMudFlowPtr)) call ReturnMudFlowPtr(status)
  269. !if(status == Clear_StatusType) if(print_log) print*,'On_ReturnMudFlow_Clear'
  270. !if(status == Executed_StatusType) if(print_log) print*,'On_ReturnMudFlow_Execute'
  271. endsubroutine
  272. subroutine ChangeTorqueLimit(status)
  273. use SimulationVariables !@
  274. implicit none
  275. integer, intent (in) :: status
  276. ! if(associated(TorqueLimitPtr)) call TorqueLimitPtr(status)
  277. if(status == Clear_StatusType) data%State%RTable%TorqueLimitGaugeMalf = 0
  278. if(status == Executed_StatusType) data%State%RTable%TorqueLimitGaugeMalf = 1
  279. endsubroutine
  280. subroutine ChangePowerLimit(status)
  281. implicit none
  282. integer, intent (in) :: status
  283. ! if(associated(PowerLimitPtr)) call PowerLimitPtr(status)
  284. !if(status == Clear_StatusType) if(print_log) print*,'On_PowerLimit_Clear'
  285. !if(status == Executed_StatusType) if(print_log) print*,'On_PowerLimit_Execute'
  286. endsubroutine
  287. subroutine ChangeAccumulatorPressure(status)
  288. use SimulationVariables
  289. implicit none
  290. integer, intent (in) :: status
  291. ! if(associated(AccumulatorPressurePtr)) call AccumulatorPressurePtr(status)
  292. if(status == Clear_StatusType) data%State%BopStackAcc%AccumulatorPressureGaugeMalf = 0
  293. if(status == Executed_StatusType) data%State%BopStackAcc%AccumulatorPressureGaugeMalf = 1
  294. endsubroutine
  295. subroutine ChangeManifoldPressure(status)
  296. use SimulationVariables
  297. implicit none
  298. integer, intent (in) :: status
  299. ! if(associated(ManifoldPressurePtr)) call ManifoldPressurePtr(status)
  300. if(status == Clear_StatusType) data%State%BopStackAcc%ManifoldPressureGaugeMalf = 0
  301. if(status == Executed_StatusType) data%State%BopStackAcc%ManifoldPressureGaugeMalf = 1
  302. endsubroutine
  303. subroutine ChangeAnnularPressure(status)
  304. use SimulationVariables
  305. implicit none
  306. integer, intent (in) :: status
  307. ! if(associated(AnnularPressurePtr)) call AnnularPressurePtr(status)
  308. if(status == Clear_StatusType) data%State%Annular%AnnularPressureGaugeMalf = 0
  309. if(status == Executed_StatusType) data%State%Annular%AnnularPressureGaugeMalf = 1
  310. endsubroutine
  311. subroutine ChangeRigAirPressure(status)
  312. use SimulationVariables
  313. implicit none
  314. integer, intent (in) :: status
  315. ! if(associated(RigAirPressurePtr)) call RigAirPressurePtr(status)
  316. if(status == Clear_StatusType) data%State%BopStackAcc%AirSupplyPressureGaugeMalf = 0
  317. if(status == Executed_StatusType) data%State%BopStackAcc%AirSupplyPressureGaugeMalf = 1
  318. endsubroutine
  319. subroutine ChangeStandPipe1(status)
  320. USE MudSystemVARIABLES
  321. use SimulationVariables !@@@
  322. implicit none
  323. integer, intent (in) :: status
  324. ! if(associated(StandPipe1Ptr)) call StandPipe1Ptr(status)
  325. if(status == Clear_StatusType) data%State%MudSystem%StandPipeGauge1Malf = 0
  326. if(status == Executed_StatusType) data%State%MudSystem%StandPipeGauge1Malf = 1
  327. endsubroutine
  328. subroutine ChangeStandPipe2(status)
  329. USE MudSystemVARIABLES
  330. use SimulationVariables !@@@
  331. implicit none
  332. integer, intent (in) :: status
  333. ! if(associated(StandPipe2Ptr)) call StandPipe2Ptr(status)
  334. if(status == Clear_StatusType) data%State%MudSystem%StandPipeGauge2Malf = 0
  335. if(status == Executed_StatusType) data%State%MudSystem%StandPipeGauge2Malf = 1
  336. endsubroutine
  337. subroutine ChangeDrillPipePressure(status)
  338. USE MudSystemVARIABLES
  339. use SimulationVariables !@@@
  340. implicit none
  341. integer, intent (in) :: status
  342. ! if(associated(DrillPipePressurePtr)) call DrillPipePressurePtr(status)
  343. if(status == Clear_StatusType) data%State%MudSystem%DrillPipePressureMalf = 0
  344. if(status == Executed_StatusType) data%State%MudSystem%DrillPipePressureMalf = 1
  345. endsubroutine
  346. subroutine ChangeChokePosition(status)
  347. USE CHOKEVARIABLES
  348. use SimulationVariables !@
  349. implicit none
  350. integer, intent (in) :: status
  351. ! if(associated(ChokePositionPtr)) call ChokePositionPtr(status)
  352. if(status == Clear_StatusType) data%State%Choke%GaugeChokePositionMailf = 0
  353. if(status == Executed_StatusType) data%State%Choke%GaugeChokePositionMailf = 1
  354. endsubroutine
  355. subroutine ChangeCasingPressure2(status)
  356. USE FricPressDropVarsModule
  357. implicit none
  358. integer, intent (in) :: status
  359. ! if(associated(CasingPressure2Ptr)) call CasingPressure2Ptr(status)
  360. if(status == Clear_StatusType) data%State%FricPressDrop%CasingPressure_ChokeMalF = 0
  361. if(status == Executed_StatusType) data%State%FricPressDrop%CasingPressure_ChokeMalF = 1
  362. endsubroutine
  363. end module CGaugesProblems