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.
 
 
 
 
 
 

409 lines
32 KiB

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