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.

преди 1 година
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  1. module GeoMain
  2. use CLog4
  3. implicit none
  4. public
  5. integer :: SampleValue, TestValue
  6. contains
  7. !========================== START - SAMPLE MODULE ===================
  8. subroutine Sample_Setup()
  9. use CSimulationVariables
  10. implicit none
  11. !call OnSimulationInitialization%Add(Sample_Init)
  12. call OnSimulationStop%Add(Sample_Stop)
  13. call OnSampleStart%Add(Sample_Start)
  14. call OnSampleStep%Add(Sample_Step)
  15. !call OnSampleOutput%Add(Sample_Output)
  16. call OnSampleMain%Add(Sample_Main)
  17. end subroutine
  18. subroutine Sample_Stop
  19. implicit none
  20. !call Log_3('****************Sample-Init')
  21. !print*, '****************Sample-Init'
  22. SampleValue = 0
  23. end subroutine Sample_Stop
  24. subroutine Sample_Start
  25. use CSimulationVariables
  26. implicit none
  27. !print*, '****************Sample_Start****************'
  28. !call Log_3( '****************Sample_Start****************' )
  29. end subroutine Sample_Start
  30. subroutine Sample_Step
  31. use CSimulationVariables
  32. implicit none
  33. !CALL DATE_AND_TIME(values=EndTime)
  34. !call time%Finish()
  35. SampleValue = SampleValue + 1
  36. !print*, '****************Sample_Step' , SampleValue
  37. !call Log_3( '****************Sample_Step' , SampleValue)
  38. end subroutine Sample_Step
  39. subroutine Sample_Output
  40. implicit none
  41. !call Log_4('****************Sample_Output:', SampleValue)
  42. !print*, '****************Sample_Output:', SampleValue, ((EndTime(6)*60000+EndTime(7)*1000+EndTime(8)) - &
  43. ! (StartTime(6)*60000+StartTime(7)*1000+StartTime(8)))
  44. !print*, 'timeElapsed=', ((EndTime(6)*60000+EndTime(7)*1000+EndTime(8)) - &
  45. !(StartTime(6)*60000+StartTime(7)*1000+StartTime(8)))
  46. !CALL DATE_AND_TIME(values=StartTime)
  47. !print*, 'timeElapsed=', time%ElapsedTimeMs(), SampleValue
  48. !call time%Start()
  49. end subroutine Sample_Output
  50. subroutine Sample_Main
  51. use CSimulationVariables
  52. implicit none
  53. !loop: do
  54. ! !call Log_4('****************Sample-Mainnnnn:', SampleValue)
  55. ! !print*, '****************Sample-Mainnnnn:', SampleValue
  56. ! call sleepqq(300)
  57. ! if(IsStopped) call Quit()
  58. !end do loop
  59. end subroutine Sample_Main
  60. !========================== END - SAMPLE MODULE ===================
  61. !M_BopStack
  62. !M_Pump1
  63. !M_Pump2
  64. !M_Pump3
  65. !M_ChokeControl
  66. !M_Rop
  67. !M_RotaryTable
  68. !M_Drawworks
  69. !M_FluidFlow
  70. !M_TorqueDrag
  71. !M_MudSystem
  72. !M_PipeRams1
  73. !M_PipeRams2
  74. !M_KillLine
  75. !M_ChokeLine
  76. !M_BlindRams
  77. !M_Annular
  78. !M_Geo
  79. !========================== END - TEST MODULE ===================
  80. subroutine SetupTest()
  81. use CSimulationVariables
  82. implicit none
  83. call OnSimulationInitialization%Add(TestInit)
  84. call OnSimulationStop%Add(TestOnStop)
  85. call OnSimulationPause%Add(TestOnPaused)
  86. end subroutine
  87. integer(4) function TestThread(arg)
  88. !DEC$ ATTRIBUTES STDCALL, ALIAS:"_testthread" :: TestThread
  89. use ifport
  90. use ifmt
  91. implicit none
  92. integer(4), pointer :: arg
  93. !call TestMain()
  94. TestThread = 0;
  95. call ExitThread(0)
  96. end function TestThread
  97. subroutine TestInit
  98. implicit none
  99. !print*, 'Test Module Init...'
  100. !TestValue = 1
  101. end subroutine TestInit
  102. subroutine TestMain
  103. use CSimulationVariables
  104. implicit none
  105. !loop: do
  106. !
  107. ! print*, 'Test-Main:', TestValue
  108. ! TestValue = TestValue + 1
  109. !
  110. ! call sleep(1)
  111. ! if(IsStopped) call Quit()
  112. !end do loop
  113. end subroutine TestMain
  114. subroutine TestOnStop
  115. use CSimulationVariables
  116. implicit none
  117. !print*, 'Test Module Stopped!'
  118. !TestValue = 1
  119. end subroutine TestOnStop
  120. subroutine TestOnPaused
  121. use CSimulationVariables
  122. implicit none
  123. !print*, 'Test Module Paused!'
  124. end subroutine TestOnPaused
  125. !========================== END - TEST MODULE ===================
  126. subroutine Setup()
  127. use CPathChangeEvents
  128. implicit none
  129. call BeforeTraverse%Add(InitialVarsBeforePathsChanges)
  130. call OnPathOpen%Add(WhenPathOpen)
  131. !call OnPathClose%Add(WhenPathClose)
  132. end subroutine
  133. subroutine InitialVarsBeforePathsChanges()
  134. implicit none
  135. #ifdef deb
  136. print*, "ValveOne: FALSE (init)"
  137. #endif
  138. end subroutine
  139. subroutine WhenPathOpen(valves)
  140. implicit none
  141. integer, allocatable, intent (in) :: valves(:)
  142. ! if ( any(valves == 1)) then
  143. !#ifdef deb
  144. ! print*, "ValveOne: TRUE"
  145. !#endif
  146. ! endif
  147. end subroutine
  148. subroutine Geo_Setup()
  149. use CSimulationVariables
  150. implicit none
  151. !call OnSimulationInitialization%Add(Geo_Init)
  152. call OnSimulationStop%Add(Geo_Stop)
  153. call OnGeoStart%Add(Geo_Start)
  154. call OnGeoStep%Add(Geo_Step)
  155. !call OnGeoOutput%Add(Geo_Output)
  156. call OnGeoMain%Add(GeoMainBody)
  157. end subroutine
  158. subroutine Geo_Stop
  159. implicit none
  160. !print*, 'Geo_Stop'
  161. end subroutine Geo_Stop
  162. subroutine Geo_Start
  163. implicit none
  164. !print*, '****************Geo_Start****************'
  165. end subroutine Geo_Start
  166. subroutine Geo_Step
  167. implicit none
  168. end subroutine Geo_Step
  169. !subroutine Geo_Output
  170. ! implicit none
  171. ! !print*, 'Geo_Output'
  172. !end subroutine Geo_Output
  173. subroutine GeoMainBody
  174. implicit none
  175. end subroutine GeoMainBody
  176. end module GeoMain