module GeoMain use CLog4 implicit none public integer :: SampleValue, TestValue contains !========================== START - SAMPLE MODULE =================== subroutine Sample_Setup() use CSimulationVariables implicit none !call OnSimulationInitialization%Add(Sample_Init) call OnSimulationStop%Add(Sample_Stop) call OnSampleStart%Add(Sample_Start) call OnSampleStep%Add(Sample_Step) !call OnSampleOutput%Add(Sample_Output) call OnSampleMain%Add(Sample_Main) end subroutine subroutine Sample_Stop implicit none !call Log_3('****************Sample-Init') !print*, '****************Sample-Init' SampleValue = 0 end subroutine Sample_Stop subroutine Sample_Start use CSimulationVariables implicit none !print*, '****************Sample_Start****************' !call Log_3( '****************Sample_Start****************' ) end subroutine Sample_Start subroutine Sample_Step use CSimulationVariables implicit none !CALL DATE_AND_TIME(values=EndTime) !call time%Finish() SampleValue = SampleValue + 1 !print*, '****************Sample_Step' , SampleValue !call Log_3( '****************Sample_Step' , SampleValue) end subroutine Sample_Step subroutine Sample_Output implicit none !call Log_4('****************Sample_Output:', SampleValue) !print*, '****************Sample_Output:', SampleValue, ((EndTime(6)*60000+EndTime(7)*1000+EndTime(8)) - & ! (StartTime(6)*60000+StartTime(7)*1000+StartTime(8))) !print*, 'timeElapsed=', ((EndTime(6)*60000+EndTime(7)*1000+EndTime(8)) - & !(StartTime(6)*60000+StartTime(7)*1000+StartTime(8))) !CALL DATE_AND_TIME(values=StartTime) !print*, 'timeElapsed=', time%ElapsedTimeMs(), SampleValue !call time%Start() end subroutine Sample_Output subroutine Sample_Main use CSimulationVariables implicit none !loop: do ! !call Log_4('****************Sample-Mainnnnn:', SampleValue) ! !print*, '****************Sample-Mainnnnn:', SampleValue ! call sleepqq(300) ! if(IsStopped) call Quit() !end do loop end subroutine Sample_Main !========================== END - SAMPLE MODULE =================== !M_BopStack !M_Pump1 !M_Pump2 !M_Pump3 !M_ChokeControl !M_Rop !M_RotaryTable !M_Drawworks !M_FluidFlow !M_TorqueDrag !M_MudSystem !M_PipeRams1 !M_PipeRams2 !M_KillLine !M_ChokeLine !M_BlindRams !M_Annular !M_Geo !========================== END - TEST MODULE =================== subroutine SetupTest() use CSimulationVariables implicit none call OnSimulationInitialization%Add(TestInit) call OnSimulationStop%Add(TestOnStop) call OnSimulationPause%Add(TestOnPaused) end subroutine integer(4) function TestThread(arg) !DEC$ ATTRIBUTES STDCALL, ALIAS:"_testthread" :: TestThread use ifport use ifmt implicit none integer(4), pointer :: arg !call TestMain() TestThread = 0; call ExitThread(0) end function TestThread subroutine TestInit implicit none !print*, 'Test Module Init...' !TestValue = 1 end subroutine TestInit subroutine TestMain use CSimulationVariables implicit none !loop: do ! ! print*, 'Test-Main:', TestValue ! TestValue = TestValue + 1 ! ! call sleep(1) ! if(IsStopped) call Quit() !end do loop end subroutine TestMain subroutine TestOnStop use CSimulationVariables implicit none !print*, 'Test Module Stopped!' !TestValue = 1 end subroutine TestOnStop subroutine TestOnPaused use CSimulationVariables implicit none !print*, 'Test Module Paused!' end subroutine TestOnPaused !========================== END - TEST MODULE =================== subroutine Setup() use CPathChangeEvents implicit none call BeforeTraverse%Add(InitialVarsBeforePathsChanges) call OnPathOpen%Add(WhenPathOpen) !call OnPathClose%Add(WhenPathClose) end subroutine subroutine InitialVarsBeforePathsChanges() implicit none #ifdef deb print*, "ValveOne: FALSE (init)" #endif end subroutine subroutine WhenPathOpen(valves) implicit none integer, allocatable, intent (in) :: valves(:) ! if ( any(valves == 1)) then !#ifdef deb ! print*, "ValveOne: TRUE" !#endif ! endif end subroutine subroutine Geo_Setup() use CSimulationVariables implicit none !call OnSimulationInitialization%Add(Geo_Init) call OnSimulationStop%Add(Geo_Stop) call OnGeoStart%Add(Geo_Start) call OnGeoStep%Add(Geo_Step) !call OnGeoOutput%Add(Geo_Output) call OnGeoMain%Add(GeoMainBody) end subroutine subroutine Geo_Stop implicit none !print*, 'Geo_Stop' end subroutine Geo_Stop subroutine Geo_Start implicit none !print*, '****************Geo_Start****************' end subroutine Geo_Start subroutine Geo_Step implicit none end subroutine Geo_Step !subroutine Geo_Output ! implicit none ! !print*, 'Geo_Output' !end subroutine Geo_Output subroutine GeoMainBody implicit none end subroutine GeoMainBody end module GeoMain