Simulation Core
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

PumpsMain.f90 7.8 KiB

il y a 1 an
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. module PumpsMain
  2. use CPumpsVariables
  3. use CDrillingConsoleVariables
  4. use CDataDisplayConsoleVariables
  5. use CSimulationVariables
  6. use Pump_VARIABLES
  7. use CSounds
  8. implicit none
  9. public
  10. contains
  11. ! ****************************************
  12. ! ***** subroutine Pump1MainBody *****
  13. ! ****************************
  14. subroutine Pump1_Setup()
  15. use CSimulationVariables
  16. implicit none
  17. call OnSimulationInitialization%Add(Pump1_Init)
  18. call OnSimulationStop%Add(Pump1_Init)
  19. call OnPump1Step%Add(Pump1_Step)
  20. call OnPump1Output%Add(Pump1_Output)
  21. call OnPump1Main%Add(Pump1MainBody)
  22. end subroutine
  23. subroutine Pump1_Init
  24. implicit none
  25. end subroutine Pump1_Init
  26. subroutine Pump1_Step
  27. Call Pump1_MainSolver
  28. end subroutine Pump1_Step
  29. subroutine Pump1_Output
  30. implicit none
  31. end subroutine Pump1_Output
  32. subroutine Pump1MainBody
  33. use ifport
  34. use ifmt
  35. !use Pump1_MainSolver
  36. use CWarningsVariables
  37. !use equipments_PowerLimit
  38. implicit none
  39. integer,dimension(8) :: MP_START_TIME, MP_END_TIME
  40. INTEGER :: MP_SolDuration
  41. Call Pump_StartUp
  42. loop1 : do
  43. Call DATE_AND_TIME(values=MP_START_TIME)
  44. Call Pump1_MainSolver
  45. Call DATE_AND_TIME(values=MP_END_TIME)
  46. MP_SolDuration = 100-(MP_END_TIME(5)*3600000+MP_END_TIME(6)*60000+MP_END_TIME(7)*1000+MP_END_TIME(8)-MP_START_TIME(5)*3600000-MP_START_TIME(6)*60000-MP_START_TIME(7)*1000-MP_START_TIME(8))
  47. if(MP_SolDuration > 0.0) then
  48. Call sleepqq(MP_SolDuration)
  49. end if
  50. if (IsStopped == .true.) then
  51. exit loop1
  52. end if
  53. end do loop1
  54. end subroutine Pump1MainBody
  55. ! ****************************************
  56. ! ***** subroutine Pump2MainBody *****
  57. ! ****************************
  58. subroutine Pump2_Setup()
  59. use CSimulationVariables
  60. implicit none
  61. call OnSimulationInitialization%Add(Pump2_Init)
  62. call OnSimulationStop%Add(Pump2_Init)
  63. call OnPump2Step%Add(Pump2_Step)
  64. call OnPump2Output%Add(Pump2_Output)
  65. call OnPump2Main%Add(Pump2MainBody)
  66. end subroutine
  67. subroutine Pump2_Init
  68. implicit none
  69. end subroutine Pump2_Init
  70. subroutine Pump2_Step
  71. call Pump2_MainSolver
  72. end subroutine Pump2_Step
  73. subroutine Pump2_Output
  74. implicit none
  75. end subroutine Pump2_Output
  76. subroutine Pump2MainBody
  77. use ifport
  78. use ifmt
  79. use CWarningsVariables
  80. implicit none
  81. integer,dimension(8) :: MP_START_TIME, MP_END_TIME
  82. INTEGER :: MP_SolDuration
  83. Call Pump_StartUp
  84. loop1 : do
  85. Call DATE_AND_TIME(values=MP_START_TIME)
  86. Call Pump2_MainSolver
  87. Call DATE_AND_TIME(values=MP_END_TIME)
  88. MP_SolDuration = 100-(MP_END_TIME(5)*3600000+MP_END_TIME(6)*60000+MP_END_TIME(7)*1000+MP_END_TIME(8)-MP_START_TIME(5)*3600000-MP_START_TIME(6)*60000-MP_START_TIME(7)*1000-MP_START_TIME(8))
  89. if(MP_SolDuration > 0.0) then
  90. Call sleepqq(MP_SolDuration)
  91. end if
  92. if (IsStopped == .true.) then
  93. exit loop1
  94. end if
  95. end do loop1
  96. end subroutine Pump2MainBody
  97. ! ****************************************
  98. ! ***** subroutine Pump3MainBody *****
  99. ! ****************************
  100. subroutine Pump3_Setup()
  101. use CSimulationVariables
  102. implicit none
  103. call OnSimulationInitialization%Add(Pump3_Init)
  104. call OnSimulationStop%Add(Pump3_Init)
  105. call OnPump3Step%Add(Pump3_Step)
  106. call OnPump3Output%Add(Pump3_Output)
  107. call OnPump3Main%Add(Pump3MainBody)
  108. end subroutine
  109. subroutine Pump3_Init
  110. implicit none
  111. end subroutine Pump3_Init
  112. subroutine Pump3_Step
  113. implicit none
  114. end subroutine Pump3_Step
  115. subroutine Pump3_Output
  116. implicit none
  117. end subroutine Pump3_Output
  118. subroutine Pump3MainBody
  119. use ifport
  120. use ifmt
  121. implicit none
  122. integer,dimension(8) :: MP_START_TIME, MP_END_TIME
  123. INTEGER :: MP_SolDuration
  124. !Call Pump_StartUp
  125. !loop1 : do
  126. !
  127. ! Call sleepqq(10)
  128. !
  129. ! !!! Pump3 Malfunction ----> Power Failure
  130. ! !!if (PUMP(1)%PowerFailMalf==1) then
  131. ! !! !MP1BLWR=0
  132. ! !! Call Pump3_OffMode_Solver
  133. ! !! Call ClosePump1()
  134. ! !!end if
  135. !
  136. ! !if( (MP1CPSwitch==1) .and. (MP1Throttle==0.) .and. (PUMP(3)%PowerFailMalf==0) ) then
  137. !!
  138. !! loop2: do
  139. !!
  140. !! Call DATE_AND_TIME(values=MP_START_TIME)
  141. !!
  142. !!!! ! Pump3 Malfunction ----> Power Failure
  143. !!!! if (PUMP(1)%PowerFailMalf==1) then
  144. !!!! !MP1BLWR=0
  145. !!!! Pump3_OffMode_Solver
  146. !!!! Call ClosePump1()
  147. !!!! exit loop2
  148. !!!! end if
  149. !!
  150. !! PUMP(3)%N_new = MP1Throttle
  151. !! if (((PUMP(3)%N_new-PUMP(3)%N_old)/PUMP(3)%time_step)>193.) then
  152. !! PUMP(3)%N_ref =(193.*PUMP(3)%time_step)+PUMP(3)%N_old
  153. !! else if (((PUMP(3)%N_old-PUMP(3)%N_new)/PUMP(3)%time_step)>193.) then
  154. !! PUMP(3)%N_ref = (-193.*PUMP(3)%time_step)+PUMP(3)%N_old
  155. !! else
  156. !! PUMP(3)%N_ref = PUMP(3)%N_new
  157. !! end if
  158. !!
  159. !! Call Pump3_OnMode_Solver
  160. !!
  161. !! IF (PUMP(3)%Flow_Rate>0.) Then
  162. !! Call OpenCementPump()
  163. !! Else
  164. !! Call CloseCementPump()
  165. !! End if
  166. !!
  167. !! PUMP(3)%N_old = PUMP(3)%N_ref
  168. !!
  169. !! Call DATE_AND_TIME(values=MP_END_TIME)
  170. !! MP_SolDuration = 100-(MP_END_TIME(6)*60000+MP_END_TIME(7)*1000+MP_END_TIME(8)-MP_START_TIME(6)*60000-MP_START_TIME(7)*1000-MP_START_TIME(8))
  171. !! !print*, 'MPtime=', MP_SolDuration
  172. !! if(MP_SolDuration > 0.0) then
  173. !! Call sleepqq(MP_SolDuration)
  174. !! end if
  175. !!
  176. !! if ((MP1CPSwitch==0) .or. (IsStopped == .true.)) then
  177. !! Call Pump3_OffMode_Solver
  178. !! Call CloseCementPump()
  179. !! exit loop2
  180. !! end if
  181. !! end do loop2
  182. !
  183. ! else
  184. !
  185. ! !Call Pump3_OffMode_Solver
  186. ! !Call CloseCementPump()
  187. !
  188. ! end if
  189. !
  190. ! if (IsStopped == .true.) then
  191. ! exit loop1
  192. ! end if
  193. !
  194. !end do loop1
  195. end subroutine Pump3MainBody
  196. end module PumpsMain