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.

CChokeManifold.f90 6.6 KiB

1 year ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. module CChokeManifold
  2. use CChokeManifoldVariables
  3. use CLog2
  4. implicit none
  5. public
  6. contains
  7. ! Input routines
  8. subroutine SetChokeManifoldValve1(v)
  9. !DEC$ ATTRIBUTES DLLEXPORT :: SetChokeManifoldValve1
  10. !DEC$ ATTRIBUTES ALIAS: 'SetChokeManifoldValve1' :: SetChokeManifoldValve1
  11. implicit none
  12. logical, intent(in) :: v
  13. ChokeManifoldValve1 = v
  14. call ChangeValve(61, v)
  15. #ifdef deb
  16. !print*, 'ChokeManifoldValve1=', ChokeManifoldValve1
  17. #endif
  18. end subroutine
  19. subroutine SetChokeManifoldValve2(v)
  20. !DEC$ ATTRIBUTES DLLEXPORT :: SetChokeManifoldValve2
  21. !DEC$ ATTRIBUTES ALIAS: 'SetChokeManifoldValve2' :: SetChokeManifoldValve2
  22. implicit none
  23. logical, intent(in) :: v
  24. ChokeManifoldValve2 = v
  25. call ChangeValve(64, v)
  26. #ifdef deb
  27. !print*, 'ChokeManifoldValve2=', ChokeManifoldValve2
  28. #endif
  29. end subroutine
  30. subroutine SetLeftManualChoke(v)
  31. !DEC$ ATTRIBUTES DLLEXPORT :: SetLeftManualChoke
  32. !DEC$ ATTRIBUTES ALIAS: 'SetLeftManualChoke' :: SetLeftManualChoke
  33. implicit none
  34. real*8, intent(in) :: v
  35. !LeftManualChoke = abs(v-100)
  36. LeftManualChoke = v
  37. if(LeftManChokeOnProblem) then
  38. call ChangeValve(32, .true.)
  39. else
  40. if(LeftManualChoke > 99.9) then
  41. !call Log_2( 'valve 32 is closed=', LeftManualChoke)
  42. call ChangeValve(32, .false.)
  43. else
  44. !call Log_2( 'valve 32 is open=', LeftManualChoke)
  45. call ChangeValve(32, .true.)
  46. endif
  47. endif
  48. #ifdef deb
  49. !print*, 'LeftManualChoke=', LeftManualChoke
  50. #endif
  51. end subroutine
  52. subroutine SetChokeManifoldValve4(v)
  53. !DEC$ ATTRIBUTES DLLEXPORT :: SetChokeManifoldValve4
  54. !DEC$ ATTRIBUTES ALIAS: 'SetChokeManifoldValve4' :: SetChokeManifoldValve4
  55. implicit none
  56. logical, intent(in) :: v
  57. ChokeManifoldValve4 = v
  58. call ChangeValve(62, v)
  59. !WRITE (*,*) ' valve 62 ', v
  60. #ifdef deb
  61. !print*, 'ChokeManifoldValve4=', ChokeManifoldValve4
  62. #endif
  63. end subroutine
  64. subroutine SetChokeManifoldValve5(v)
  65. !DEC$ ATTRIBUTES DLLEXPORT :: SetChokeManifoldValve5
  66. !DEC$ ATTRIBUTES ALIAS: 'SetChokeManifoldValve5' :: SetChokeManifoldValve5
  67. implicit none
  68. logical, intent(in) :: v
  69. ChokeManifoldValve5 = v
  70. call ChangeValve(63, v)
  71. !WRITE (*,*) ' valve 63 ', v
  72. #ifdef deb
  73. !print*, 'ChokeManifoldValve5=', ChokeManifoldValve5
  74. #endif
  75. end subroutine
  76. subroutine SetRightManualChoke(v)
  77. !DEC$ ATTRIBUTES DLLEXPORT :: SetRightManualChoke
  78. !DEC$ ATTRIBUTES ALIAS: 'SetRightManualChoke' :: SetRightManualChoke
  79. implicit none
  80. real*8, intent(in) :: v
  81. !RightManualChoke = abs(v -100)
  82. RightManualChoke = v
  83. if(RightManChokeOnProblem) then
  84. call ChangeValve(35, .true.)
  85. else
  86. if(RightManualChoke > 99.9) then
  87. !call Log_2( 'valve 35 is closed=', RightManualChoke)
  88. call ChangeValve(35, .false.)
  89. else
  90. !call Log_2( 'valve 35 is open=', RightManualChoke)
  91. call ChangeValve(35, .true.)
  92. endif
  93. endif
  94. #ifdef deb
  95. !print*, 'RightManualChoke=', RightManualChoke
  96. #endif
  97. end subroutine
  98. subroutine SetChokeManifoldValve7(v)
  99. !DEC$ ATTRIBUTES DLLEXPORT :: SetChokeManifoldValve7
  100. !DEC$ ATTRIBUTES ALIAS: 'SetChokeManifoldValve7' :: SetChokeManifoldValve7
  101. implicit none
  102. logical, intent(in) :: v
  103. ChokeManifoldValve7 = v
  104. call ChangeValve(27, v)
  105. #ifdef deb
  106. !print*, 'ChokeManifoldValve7=', ChokeManifoldValve7
  107. #endif
  108. end subroutine
  109. subroutine SetChokeManifoldValve8(v)
  110. !DEC$ ATTRIBUTES DLLEXPORT :: SetChokeManifoldValve8
  111. !DEC$ ATTRIBUTES ALIAS: 'SetChokeManifoldValve8' :: SetChokeManifoldValve8
  112. implicit none
  113. logical, intent(in) :: v
  114. ChokeManifoldValve8 = v
  115. call ChangeValve(28, v)
  116. !WRITE (*,*) ' valve 28 ', v
  117. #ifdef deb
  118. !print*, 'ChokeManifoldValve8=', ChokeManifoldValve8
  119. #endif
  120. end subroutine
  121. subroutine SetChokeManifoldValve9(v)
  122. !DEC$ ATTRIBUTES DLLEXPORT :: SetChokeManifoldValve9
  123. !DEC$ ATTRIBUTES ALIAS: 'SetChokeManifoldValve9' :: SetChokeManifoldValve9
  124. implicit none
  125. logical, intent(in) :: v
  126. ChokeManifoldValve9 = v
  127. call ChangeValve(29, v)
  128. #ifdef deb
  129. !print*, 'ChokeManifoldValve9=', ChokeManifoldValve9
  130. #endif
  131. end subroutine
  132. subroutine SetChokeManifoldValve10(v)
  133. !DEC$ ATTRIBUTES DLLEXPORT :: SetChokeManifoldValve10
  134. !DEC$ ATTRIBUTES ALIAS: 'SetChokeManifoldValve10' :: SetChokeManifoldValve10
  135. implicit none
  136. logical, intent(in) :: v
  137. ChokeManifoldValve10 = v
  138. call ChangeValve(30, v)
  139. !WRITE (*,*) ' valve 30 ', v
  140. #ifdef deb
  141. !print*, 'ChokeManifoldValve10=', ChokeManifoldValve10
  142. #endif
  143. end subroutine
  144. subroutine SetChokeManifoldValve11(v)
  145. !DEC$ ATTRIBUTES DLLEXPORT :: SetChokeManifoldValve11
  146. !DEC$ ATTRIBUTES ALIAS: 'SetChokeManifoldValve11' :: SetChokeManifoldValve11
  147. implicit none
  148. logical, intent(in) :: v
  149. ChokeManifoldValve11 = v
  150. call ChangeValve(31, v)
  151. #ifdef deb
  152. !print*, 'ChokeManifoldValve11=', ChokeManifoldValve11
  153. #endif
  154. end subroutine
  155. subroutine SetChokeManifoldValve12(v)
  156. !DEC$ ATTRIBUTES DLLEXPORT :: SetChokeManifoldValve12
  157. !DEC$ ATTRIBUTES ALIAS: 'SetChokeManifoldValve12' :: SetChokeManifoldValve12
  158. implicit none
  159. logical, intent(in) :: v
  160. ChokeManifoldValve12 = v
  161. call ChangeValve(25, v)
  162. #ifdef deb
  163. !print*, 'ChokeManifoldValve12=', ChokeManifoldValve12
  164. #endif
  165. end subroutine
  166. subroutine SetChokeManifoldValve13(v)
  167. !DEC$ ATTRIBUTES DLLEXPORT :: SetChokeManifoldValve13
  168. !DEC$ ATTRIBUTES ALIAS: 'SetChokeManifoldValve13' :: SetChokeManifoldValve13
  169. implicit none
  170. logical, intent(in) :: v
  171. ChokeManifoldValve13 = v
  172. call ChangeValve(26, v)
  173. !WRITE (*,*) ' valve 26 ', v
  174. #ifdef deb
  175. !print*, 'ChokeManifoldValve13=', ChokeManifoldValve13
  176. #endif
  177. end subroutine
  178. ! Output routines
  179. integer function GetHydraulicChock1()
  180. !DEC$ ATTRIBUTES DLLEXPORT :: GetHydraulicChock1
  181. !DEC$ ATTRIBUTES ALIAS: 'GetHydraulicChock1' :: GetHydraulicChock1
  182. implicit none
  183. GetHydraulicChock1 = HydraulicChock1
  184. !GetHydraulicChock1 = 23
  185. end function
  186. integer function GetHydraulicChock2()
  187. !DEC$ ATTRIBUTES DLLEXPORT :: GetHydraulicChock2
  188. !DEC$ ATTRIBUTES ALIAS: 'GetHydraulicChock2' :: GetHydraulicChock2
  189. implicit none
  190. GetHydraulicChock2 = HydraulicChock2
  191. !GetHydraulicChock2 = 54
  192. end function
  193. end module CChokeManifold