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.

CUnityOutputs.i90 4.9 KiB

1 year ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. # 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/OperationScenarios/Unity/CUnityOutputs.f90"
  2. module CUnityOutputs
  3. implicit none
  4. type :: UnityOutputsType
  5. real(8) :: KellyHoseVibrationRate
  6. real(8) :: BlowoutFromStringPercent
  7. real(8) :: Pedal
  8. real(8) :: FlowRate
  9. real(8) :: RotaryRpm
  10. logical :: BlowoutFromString
  11. logical :: BlowoutFromAnnular
  12. logical :: FlowFromReturnLine
  13. real :: FlowFromKelly
  14. real :: FlowFromFillupHead
  15. logical :: FlowKellyDisconnect
  16. logical :: FlowPipeDisconnect
  17. end type UnityOutputsType
  18. type(UnityOutputsType):: UnityOutputs
  19. contains
  20. ! subroutine Setup()
  21. ! use CDataDisplayConsole
  22. ! use ConfigurationVariables
  23. ! implicit none
  24. ! ! PumpsSpmChanges => Calc_KellyHoseVibrationRate
  25. ! ! call data%Equipments%DataDisplayConsole%OnRotaryRpmChange%Add(Set_RotaryRpm)
  26. ! end subroutine
  27. subroutine Set_BlowoutFromString(v)
  28. implicit none
  29. logical, intent (in) :: v
  30. UnityOutputs%BlowoutFromString = v
  31. # 44
  32. end subroutine
  33. logical function Get_BlowoutFromString()
  34. implicit none
  35. Get_BlowoutFromString = UnityOutputs%BlowoutFromString
  36. end function
  37. subroutine Set_BlowoutFromAnnular(v)
  38. implicit none
  39. logical, intent (in) :: v
  40. UnityOutputs%BlowoutFromAnnular = v
  41. # 58
  42. end subroutine
  43. logical function Get_BlowoutFromAnnular()
  44. implicit none
  45. Get_BlowoutFromAnnular = UnityOutputs%BlowoutFromAnnular
  46. end function
  47. subroutine Set_FlowFromReturnLine(v)
  48. implicit none
  49. logical, intent (in) :: v
  50. UnityOutputs%FlowFromReturnLine = v
  51. # 76
  52. end subroutine
  53. logical function Get_FlowFromReturnLine()
  54. implicit none
  55. Get_FlowFromReturnLine = UnityOutputs%FlowFromReturnLine
  56. end function
  57. subroutine Set_FlowFromKelly(v)
  58. implicit none
  59. real, intent (in) :: v
  60. UnityOutputs%FlowFromKelly = v
  61. # 92
  62. end subroutine
  63. real function Get_FlowFromKelly()
  64. implicit none
  65. Get_FlowFromKelly = UnityOutputs%FlowFromKelly
  66. end function
  67. subroutine Set_FlowFromFillupHead(v)
  68. implicit none
  69. real, intent (in) :: v
  70. UnityOutputs%FlowFromFillupHead = v
  71. # 110
  72. end subroutine
  73. real function Get_FlowFromFillupHead()
  74. implicit none
  75. Get_FlowFromFillupHead = UnityOutputs%FlowFromFillupHead
  76. end function
  77. subroutine Set_FlowKellyDisconnect(v)
  78. implicit none
  79. logical, intent (in) :: v
  80. UnityOutputs%FlowKellyDisconnect = v
  81. # 129
  82. end subroutine
  83. logical function Get_FlowKellyDisconnect()
  84. implicit none
  85. Get_FlowKellyDisconnect = UnityOutputs%FlowKellyDisconnect
  86. end function
  87. subroutine Set_FlowPipeDisconnect(v)
  88. implicit none
  89. logical, intent (in) :: v
  90. UnityOutputs%FlowPipeDisconnect = v
  91. # 146
  92. end subroutine
  93. logical function Get_FlowPipeDisconnect()
  94. implicit none
  95. Get_FlowPipeDisconnect = UnityOutputs%FlowPipeDisconnect
  96. end function
  97. subroutine Set_BlowoutFromStringPercent(v)
  98. implicit none
  99. real(8), intent (in) :: v
  100. UnityOutputs%BlowoutFromStringPercent = v
  101. # 160
  102. end subroutine
  103. real(8) function GetBlowoutFromStringPercent()
  104. implicit none
  105. GetBlowoutFromStringPercent = UnityOutputs%BlowoutFromStringPercent
  106. end function
  107. subroutine Calc_KellyHoseVibrationRate(spm1, spm2)
  108. use CScaleRange
  109. implicit none
  110. real(8), intent (in) :: spm1, spm2
  111. real :: total
  112. total = (spm1 + spm2)/2
  113. UnityOutputs%KellyHoseVibrationRate = ScaleRange(total, 0.0, 10.0, 0.0, 120.0)
  114. # 177
  115. end subroutine
  116. real(8) function GetKellyHoseVibrationRate()
  117. implicit none
  118. GetKellyHoseVibrationRate = UnityOutputs%KellyHoseVibrationRate
  119. end function
  120. subroutine Set_Pedal(v)
  121. implicit none
  122. real(8), intent (in) :: v
  123. UnityOutputs%Pedal = v
  124. # 191
  125. end subroutine
  126. real(8) function GetPedal()
  127. implicit none
  128. GetPedal = UnityOutputs%Pedal
  129. end function
  130. subroutine Set_FlowRate(v)
  131. implicit none
  132. real(8), intent (in) :: v
  133. UnityOutputs%FlowRate = v
  134. # 205
  135. end subroutine
  136. real(8) function GetFlowRate()
  137. implicit none
  138. GetFlowRate = UnityOutputs%FlowRate
  139. end function
  140. subroutine Set_RotaryRpm(v)
  141. implicit none
  142. real(8), intent (in) :: v
  143. UnityOutputs%RotaryRpm = v
  144. # 219
  145. end subroutine
  146. real(8) function GetRotaryRpm()
  147. implicit none
  148. GetRotaryRpm = UnityOutputs%RotaryRpm
  149. end function
  150. end module CUnityOutputs