|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719 |
- module PumpsMain
-
- use CPumpsVariables
- use CDrillingConsoleVariables
- use CDataDisplayConsoleVariables
- use CSimulationVariables
- use Pump_VARIABLES
- use CSounds
-
- implicit none
- public
-
- contains
-
-
-
- ! ****************************************
- ! ***** subroutine Pump1MainBody *****
- ! ****************************
-
- subroutine Pump1_Setup()
- use CSimulationVariables
- implicit none
- call OnSimulationInitialization%Add(Pump1_Init)
- call OnSimulationStop%Add(Pump1_Init)
- call OnPump1Step%Add(Pump1_Step)
- call OnPump1Output%Add(Pump1_Output)
- call OnPump1Main%Add(Pump1MainBody)
- end subroutine
-
- subroutine Pump1_Init
- implicit none
- end subroutine Pump1_Init
-
- !!Extracted from pump1MainBody
- subroutine Pump1_Step
- use CWarningsVariables
- integer,dimension(8) :: MP_START_TIME, MP_END_TIME
- INTEGER :: MP_SolDuration
-
- if (PUMP(1)%PowerFailMalf==1) then
- !MP1BLWR=0
- Call Pump1_OffMode_Solver(1)
- Call ClosePump1()
- end if
- ! Pump1 Warning ----> Failure
- if (Pump1Failure==1) then
- !MP1BLWR=0
- Call Pump1_OffMode_Solver(1)
- Call ClosePump1()
- end if
-
- ! Pump3 Malfunction ----> Power Failure
- if (PUMP(3)%PowerFailMalf==1) then
- Call Pump3_OffMode_Solver
- !Call ClosePump3()
- end if
- ! Pump3 Warning ----> Failure
- if (Pump3Failure==1) then
- Call Pump3_OffMode_Solver
- !Call ClosePump3()
- end if
-
-
- !print*, 'MP1Throttle=', MP1Throttle
- if (IsPortable) then
- PUMP(1)%AssignmentSwitchh = 1
- else
- PUMP(1)%AssignmentSwitchh = AssignmentSwitch
- end if
- if((any(PUMP(1)%AssignmentSwitchh==(/1,2,3,4,9,10/))) .and. (MP1CPSwitch==-1) .and. (MP1Throttle==0.) .and. (PUMP(1)%PowerFailMalf==0)) then
- !print*, 'pumps on'
- !print*, 'PUMP(1)%AssignmentSwitchh=' , PUMP(1)%AssignmentSwitchh
- PUMP(1)%SoundBlower = .true.
- Call SetSoundBlowerMP1(PUMP(1)%SoundBlower)
- MP1BLWR = 1
-
- loop2: do
- Call DrillingConsole_ScrLEDs
- Call Pump_Total_Counts
-
- Call DATE_AND_TIME(values=MP_START_TIME)
-
- ! Pump1 Malfunction ----> Power Failure
- if (PUMP(1)%PowerFailMalf==1) then
- !MP1BLWR=0
- Call Pump1_OffMode_Solver(1)
- Call ClosePump1()
- exit loop2
- end if
-
-
- ! Pump1 Warning ----> Failure
- if (Pump1Failure==1) then
- !MP1BLWR=0
- Call Pump1_OffMode_Solver(1)
- Call ClosePump1()
- exit loop2
- end if
-
-
- PUMP(1)%N_new = MP1Throttle
- if (((PUMP(1)%N_new-PUMP(1)%N_old)/PUMP(1)%time_step)>193.) then
- PUMP(1)%N_ref =(193.*PUMP(1)%time_step)+PUMP(1)%N_old
- else if (((PUMP(1)%N_old-PUMP(1)%N_new)/PUMP(1)%time_step)>193.) then
- PUMP(1)%N_ref = (-193.*PUMP(1)%time_step)+PUMP(1)%N_old
- else
- PUMP(1)%N_ref = PUMP(1)%N_new
- end if
- !print*, 'PUMP(1)%N_ref=' , PUMP(1)%N_ref , MP1Throttle
- Call Pump1_OnMode_Solver(1)
-
- !IF (PUMP(1)%Flow_Rate>0.) Then
- ! Call OpenPump1()
- !Else
- ! Call ClosePump1()
- !End if
-
- PUMP(1)%N_old = PUMP(1)%N_ref
-
- Call DATE_AND_TIME(values=MP_END_TIME)
- 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))
- !print*, 'MPtime=', MP_SolDuration
- if(MP_SolDuration > 0.0) then
- Call sleepqq(MP_SolDuration)
- end if
-
- if (IsPortable) then
- PUMP(1)%AssignmentSwitchh = 1
- else
- PUMP(1)%AssignmentSwitchh = AssignmentSwitch
- end if
- if ((any(PUMP(1)%AssignmentSwitchh==(/5,6,7,8,11,12/))) .or. (MP1CPSwitch/=-1) .or. (IsStopped == .true.)) then
- PUMP(1)%SoundBlower = .false.
- Call SetSoundBlowerMP1(PUMP(1)%SoundBlower)
- MP1BLWR = 0
- Call Pump1_OffMode_Solver(1)
- Call ClosePump1()
- exit loop2
- end if
- end do loop2
-
- else if( (MP1CPSwitch==1) .and. (MP1Throttle==0.) .and. (PUMP(3)%PowerFailMalf==0) ) then
-
- loop3: do
- Call DATE_AND_TIME(values=MP_START_TIME)
- !print*, 'PUMP(3) is on'
-
- ! Pump3 Malfunction ----> Power Failure
- if (PUMP(3)%PowerFailMalf==1) then
- Call Pump3_OffMode_Solver
- !Call ClosePump3()
- exit loop3
- end if
-
-
- ! Pump3 Warning ----> Failure
- if (Pump3Failure==1) then
- !MP1BLWR=0
- Call Pump3_OffMode_Solver
- !Call ClosePump3() !?????????????
- exit loop3
- end if
-
-
- PUMP(3)%N_new = MP1Throttle
- if (((PUMP(3)%N_new-PUMP(3)%N_old)/PUMP(3)%time_step)>193.) then
- PUMP(3)%N_ref =(193.*PUMP(3)%time_step)+PUMP(3)%N_old
- else if (((PUMP(3)%N_old-PUMP(3)%N_new)/PUMP(3)%time_step)>193.) then
- PUMP(3)%N_ref = (-193.*PUMP(3)%time_step)+PUMP(3)%N_old
- else
- PUMP(3)%N_ref = PUMP(3)%N_new
- end if
-
- Call Pump3_OnMode_Solver
-
- IF (PUMP(3)%Flow_Rate>0.) Then
- Call OpenCementPump()
- Else
- Call CloseCementPump()
- End if
-
- PUMP(3)%N_old = PUMP(3)%N_ref
-
- Call DATE_AND_TIME(values=MP_END_TIME)
- 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))
- !print*, 'MPtime=', MP_SolDuration
- if(MP_SolDuration > 0.0) then
- Call sleepqq(MP_SolDuration)
- end if
-
- if ((MP1CPSwitch/=1) .or. (IsStopped == .true.)) then
- Call Pump3_OffMode_Solver
- Call CloseCementPump()
- exit loop3
- end if
- end do loop3
- else
- !print*, 'pumps off'
- if (IsPortable) then
- PUMP(1)%AssignmentSwitchh = 1
- !print*, 'PUMP(1)%AssignmentSwitchh2=' , PUMP(1)%AssignmentSwitchh
- else
- PUMP(1)%AssignmentSwitchh = AssignmentSwitch
- !print*, 'PUMP(1)%AssignmentSwitchh22=' , PUMP(1)%AssignmentSwitchh , AssignmentSwitch
- end if
- if ((any(PUMP(1)%AssignmentSwitchh==(/1,2,3,4,9,10/))) .and. (MP1CPSwitch==-1)) then
- PUMP(1)%SoundBlower = .true.
- Call SetSoundBlowerMP1(PUMP(1)%SoundBlower)
- MP1BLWR = 1
- else
- PUMP(1)%SoundBlower = .false.
- Call SetSoundBlowerMP1(PUMP(1)%SoundBlower)
- MP1BLWR = 0
- end if
-
-
- Call Pump1_OffMode_Solver(1)
- Call ClosePump1()
- Call Pump3_OffMode_Solver
- Call CloseCementPump()
- !print*, 'PUMP(1)%off=', PUMP(1)%dt , PUMP(1)%ia , PUMP(1)%w , PUMP(1)%n , PUMP(1)%x
- end if
- end subroutine Pump1_Step
-
- subroutine Pump1_Output
- implicit none
- end subroutine Pump1_Output
-
- subroutine Pump1MainBody
- use ifport
- use ifmt
- use CWarningsVariables
- !use equipments_PowerLimit
- implicit none
-
- integer,dimension(8) :: MP_START_TIME, MP_END_TIME
- INTEGER :: MP_SolDuration
-
- Call Pump_StartUp
- loop1 : do
- Call sleepqq(10)
- Call DrillingConsole_ScrLEDs
- !Call Pump_Total_Counts
- ! Pump1 Malfunction ----> Power Failure
- if (PUMP(1)%PowerFailMalf==1) then
- !MP1BLWR=0
- Call Pump1_OffMode_Solver(1)
- Call ClosePump1()
- end if
- ! Pump1 Warning ----> Failure
- if (Pump1Failure==1) then
- !MP1BLWR=0
- Call Pump1_OffMode_Solver(1)
- Call ClosePump1()
- end if
-
-
- ! Pump3 Malfunction ----> Power Failure
- if (PUMP(3)%PowerFailMalf==1) then
- Call Pump3_OffMode_Solver
- !Call ClosePump3()
- end if
- ! Pump3 Warning ----> Failure
- if (Pump3Failure==1) then
- Call Pump3_OffMode_Solver
- !Call ClosePump3()
- end if
-
-
- !print*, 'MP1Throttle=', MP1Throttle
- if (IsPortable) then
- PUMP(1)%AssignmentSwitchh = 1
- else
- PUMP(1)%AssignmentSwitchh = AssignmentSwitch
- end if
- if((any(PUMP(1)%AssignmentSwitchh==(/1,2,3,4,9,10/))) .and. (MP1CPSwitch==-1) .and. (MP1Throttle==0.) .and. (PUMP(1)%PowerFailMalf==0)) then
- !print*, 'pumps on'
- !print*, 'PUMP(1)%AssignmentSwitchh=' , PUMP(1)%AssignmentSwitchh
- PUMP(1)%SoundBlower = .true.
- Call SetSoundBlowerMP1(PUMP(1)%SoundBlower)
- MP1BLWR = 1
-
- loop2: do
- Call DrillingConsole_ScrLEDs
- Call Pump_Total_Counts
-
- Call DATE_AND_TIME(values=MP_START_TIME)
-
- ! Pump1 Malfunction ----> Power Failure
- if (PUMP(1)%PowerFailMalf==1) then
- !MP1BLWR=0
- Call Pump1_OffMode_Solver(1)
- Call ClosePump1()
- exit loop2
- end if
-
-
- ! Pump1 Warning ----> Failure
- if (Pump1Failure==1) then
- !MP1BLWR=0
- Call Pump1_OffMode_Solver(1)
- Call ClosePump1()
- exit loop2
- end if
-
-
- PUMP(1)%N_new = MP1Throttle
- if (((PUMP(1)%N_new-PUMP(1)%N_old)/PUMP(1)%time_step)>193.) then
- PUMP(1)%N_ref =(193.*PUMP(1)%time_step)+PUMP(1)%N_old
- else if (((PUMP(1)%N_old-PUMP(1)%N_new)/PUMP(1)%time_step)>193.) then
- PUMP(1)%N_ref = (-193.*PUMP(1)%time_step)+PUMP(1)%N_old
- else
- PUMP(1)%N_ref = PUMP(1)%N_new
- end if
- !print*, 'PUMP(1)%N_ref=' , PUMP(1)%N_ref , MP1Throttle
- Call Pump1_OnMode_Solver(1)
-
- !IF (PUMP(1)%Flow_Rate>0.) Then
- ! Call OpenPump1()
- !Else
- ! Call ClosePump1()
- !End if
-
- PUMP(1)%N_old = PUMP(1)%N_ref
-
- Call DATE_AND_TIME(values=MP_END_TIME)
- 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))
- !print*, 'MPtime=', MP_SolDuration
- if(MP_SolDuration > 0.0) then
- Call sleepqq(MP_SolDuration)
- end if
-
- if (IsPortable) then
- PUMP(1)%AssignmentSwitchh = 1
- else
- PUMP(1)%AssignmentSwitchh = AssignmentSwitch
- end if
- if ((any(PUMP(1)%AssignmentSwitchh==(/5,6,7,8,11,12/))) .or. (MP1CPSwitch/=-1) .or. (IsStopped == .true.)) then
- PUMP(1)%SoundBlower = .false.
- Call SetSoundBlowerMP1(PUMP(1)%SoundBlower)
- MP1BLWR = 0
- Call Pump1_OffMode_Solver(1)
- Call ClosePump1()
- exit loop2
- end if
- end do loop2
-
- else if( (MP1CPSwitch==1) .and. (MP1Throttle==0.) .and. (PUMP(3)%PowerFailMalf==0) ) then
-
- loop3: do
- Call DATE_AND_TIME(values=MP_START_TIME)
- !print*, 'PUMP(3) is on'
-
- ! Pump3 Malfunction ----> Power Failure
- if (PUMP(3)%PowerFailMalf==1) then
- Call Pump3_OffMode_Solver
- !Call ClosePump3()
- exit loop3
- end if
-
-
- ! Pump3 Warning ----> Failure
- if (Pump3Failure==1) then
- !MP1BLWR=0
- Call Pump3_OffMode_Solver
- !Call ClosePump3() !?????????????
- exit loop3
- end if
-
-
- PUMP(3)%N_new = MP1Throttle
- if (((PUMP(3)%N_new-PUMP(3)%N_old)/PUMP(3)%time_step)>193.) then
- PUMP(3)%N_ref =(193.*PUMP(3)%time_step)+PUMP(3)%N_old
- else if (((PUMP(3)%N_old-PUMP(3)%N_new)/PUMP(3)%time_step)>193.) then
- PUMP(3)%N_ref = (-193.*PUMP(3)%time_step)+PUMP(3)%N_old
- else
- PUMP(3)%N_ref = PUMP(3)%N_new
- end if
-
- Call Pump3_OnMode_Solver
-
- IF (PUMP(3)%Flow_Rate>0.) Then
- Call OpenCementPump()
- Else
- Call CloseCementPump()
- End if
-
- PUMP(3)%N_old = PUMP(3)%N_ref
-
- Call DATE_AND_TIME(values=MP_END_TIME)
- 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))
- !print*, 'MPtime=', MP_SolDuration
- if(MP_SolDuration > 0.0) then
- Call sleepqq(MP_SolDuration)
- end if
-
- if ((MP1CPSwitch/=1) .or. (IsStopped == .true.)) then
- Call Pump3_OffMode_Solver
- Call CloseCementPump()
- exit loop3
- end if
- end do loop3
-
- else
- !print*, 'pumps off'
- if (IsPortable) then
- PUMP(1)%AssignmentSwitchh = 1
- !print*, 'PUMP(1)%AssignmentSwitchh2=' , PUMP(1)%AssignmentSwitchh
- else
- PUMP(1)%AssignmentSwitchh = AssignmentSwitch
- !print*, 'PUMP(1)%AssignmentSwitchh22=' , PUMP(1)%AssignmentSwitchh , AssignmentSwitch
- end if
- if ((any(PUMP(1)%AssignmentSwitchh==(/1,2,3,4,9,10/))) .and. (MP1CPSwitch==-1)) then
- PUMP(1)%SoundBlower = .true.
- Call SetSoundBlowerMP1(PUMP(1)%SoundBlower)
- MP1BLWR = 1
- else
- PUMP(1)%SoundBlower = .false.
- Call SetSoundBlowerMP1(PUMP(1)%SoundBlower)
- MP1BLWR = 0
- end if
-
-
- Call Pump1_OffMode_Solver(1)
- Call ClosePump1()
- Call Pump3_OffMode_Solver
- Call CloseCementPump()
- !print*, 'PUMP(1)%off=', PUMP(1)%dt , PUMP(1)%ia , PUMP(1)%w , PUMP(1)%n , PUMP(1)%x
-
- end if
-
- if (IsStopped == .true.) then
- exit loop1
- end if
-
- end do loop1
-
-
- end subroutine Pump1MainBody
-
-
-
-
-
- ! ****************************************
- ! ***** subroutine Pump2MainBody *****
- ! ****************************
- subroutine Pump2_Setup()
- use CSimulationVariables
- implicit none
- call OnSimulationInitialization%Add(Pump2_Init)
- call OnSimulationStop%Add(Pump2_Init)
- call OnPump2Step%Add(Pump2_Step)
- call OnPump2Output%Add(Pump2_Output)
- call OnPump2Main%Add(Pump2MainBody)
- end subroutine
-
- subroutine Pump2_Init
- implicit none
- end subroutine Pump2_Init
-
- subroutine Pump2_Step
- implicit none
- end subroutine Pump2_Step
-
- subroutine Pump2_Output
- implicit none
- end subroutine Pump2_Output
-
- subroutine Pump2MainBody
- use ifport
- use ifmt
- use CWarningsVariables
- implicit none
-
- integer,dimension(8) :: MP_START_TIME, MP_END_TIME
- INTEGER :: MP_SolDuration
-
- Call Pump_StartUp
- loop1 : do
-
- Call sleepqq(10)
-
- ! Pump2 Malfunction ----> Power Failure
- if (PUMP(2)%PowerFailMalf==1) then
- Call ClosePump2()
- !MP2BLWR=0
- Call Pump2_OffMode_Solver(2)
- end if
-
-
- ! Pump2 Warning ----> Failure
- if (Pump2Failure==1) then
- !MP1BLWR=0
- Call Pump2_OffMode_Solver(2)
- Call ClosePump2()
- end if
-
-
- if (IsPortable) then
- PUMP(2)%AssignmentSwitchh = 1
- else
- PUMP(2)%AssignmentSwitchh = AssignmentSwitch
- end if
- if((any(PUMP(2)%AssignmentSwitchh==(/1,2,3,4,5,7,8,11/))) .and. (MP2Switch==1) .and. (MP2Throttle==0.).and. (PUMP(2)%PowerFailMalf==0)) then
-
- PUMP(2)%SoundBlower = .true.
- Call SetSoundBlowerMP2(PUMP(2)%SoundBlower)
- MP2BLWR = 1
-
- loop2: do
- CALL DATE_AND_TIME(values=MP_START_TIME)
-
- ! Pump2 Malfunction ----> Power Failure
- if (PUMP(2)%PowerFailMalf==1) then
- Call ClosePump2()
- !MP2BLWR=0
- Call Pump2_OffMode_Solver(2)
- exit loop2
- end if
-
-
- ! Pump2 Warning ----> Failure
- if (Pump2Failure==1) then
- Call ClosePump2()
- !MP2BLWR=0
- Call Pump2_OffMode_Solver(2)
- exit loop2
- end if
-
-
- PUMP(2)%N_new = MP2Throttle
- if (((PUMP(2)%N_new-PUMP(2)%N_old)/PUMP(2)%time_step)>193.) then
- PUMP(2)%N_ref = (193.*PUMP(2)%time_step)+PUMP(2)%N_old
- else if (((PUMP(2)%N_old-PUMP(2)%N_new)/PUMP(2)%time_step)>193.) then
- PUMP(2)%N_ref = (-193.*PUMP(2)%time_step)+PUMP(2)%N_old
- else
- PUMP(2)%N_ref = PUMP(2)%N_new
- end if
-
- Call Pump2_OnMode_Solver(2)
-
- !IF (PUMP(2)%Flow_Rate>0.) Then
- ! Call OpenPump2()
- !Else
- ! Call ClosePump2()
- !End if
-
- PUMP(2)%N_old=PUMP(2)%N_ref
-
- Call DATE_AND_TIME(values=MP_END_TIME)
- 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))
- !print*, 'MPtime=', MP_SolDuration
- if(MP_SolDuration > 0.0d0) then
- CALL sleepqq(MP_SolDuration)
- end if
-
- if (IsPortable) then
- PUMP(2)%AssignmentSwitchh = 1
- else
- PUMP(2)%AssignmentSwitchh = AssignmentSwitch
- end if
- if ((any(PUMP(2)%AssignmentSwitchh==(/6,9,10,12/))) .or. (MP2Switch==0) .or. (IsStopped == .true.)) then
- Call ClosePump2()
- PUMP(2)%SoundBlower = .false.
- Call SetSoundBlowerMP2(PUMP(2)%SoundBlower)
- MP2BLWR = 0
- Call Pump2_OffMode_Solver(2)
- exit loop2
- end if
-
- end do loop2
-
- else
-
- if (IsPortable) then
- PUMP(2)%AssignmentSwitchh = 1
- else
- PUMP(2)%AssignmentSwitchh = AssignmentSwitch
- end if
- if((any(PUMP(2)%AssignmentSwitchh==(/1,2,3,4,5,7,8,11/))) .and. (MP2Switch==1)) then
- PUMP(2)%SoundBlower = .true.
- Call SetSoundBlowerMP2(PUMP(2)%SoundBlower)
- MP2BLWR = 1
- else
- PUMP(2)%SoundBlower = .false.
- Call SetSoundBlowerMP2(PUMP(2)%SoundBlower)
- MP2BLWR = 0
- end if
-
- PUMP(2)%N_ref = MP2Throttle
- Call ClosePump2()
- Call Pump2_OffMode_Solver(2)
-
- end if
-
- if (IsStopped == .true.) then
- exit loop1
- end if
-
- end do loop1
-
-
- end subroutine Pump2MainBody
-
-
-
-
- ! ****************************************
- ! ***** subroutine Pump3MainBody *****
- ! ****************************
- subroutine Pump3_Setup()
- use CSimulationVariables
- implicit none
- call OnSimulationInitialization%Add(Pump3_Init)
- call OnSimulationStop%Add(Pump3_Init)
- call OnPump3Step%Add(Pump3_Step)
- call OnPump3Output%Add(Pump3_Output)
- call OnPump3Main%Add(Pump3MainBody)
- end subroutine
-
- subroutine Pump3_Init
- implicit none
- end subroutine Pump3_Init
-
- subroutine Pump3_Step
- implicit none
- end subroutine Pump3_Step
-
- subroutine Pump3_Output
- implicit none
- end subroutine Pump3_Output
-
- subroutine Pump3MainBody
- use ifport
- use ifmt
- implicit none
-
-
- integer,dimension(8) :: MP_START_TIME, MP_END_TIME
- INTEGER :: MP_SolDuration
-
- !Call Pump_StartUp
- !loop1 : do
- !
- ! Call sleepqq(10)
- !
- ! !!! Pump3 Malfunction ----> Power Failure
- ! !!if (PUMP(1)%PowerFailMalf==1) then
- ! !! !MP1BLWR=0
- ! !! Call Pump3_OffMode_Solver
- ! !! Call ClosePump1()
- ! !!end if
- !
- ! !if( (MP1CPSwitch==1) .and. (MP1Throttle==0.) .and. (PUMP(3)%PowerFailMalf==0) ) then
- !!
- !! loop2: do
- !!
- !! Call DATE_AND_TIME(values=MP_START_TIME)
- !!
- !!!! ! Pump3 Malfunction ----> Power Failure
- !!!! if (PUMP(1)%PowerFailMalf==1) then
- !!!! !MP1BLWR=0
- !!!! Pump3_OffMode_Solver
- !!!! Call ClosePump1()
- !!!! exit loop2
- !!!! end if
- !!
- !! PUMP(3)%N_new = MP1Throttle
- !! if (((PUMP(3)%N_new-PUMP(3)%N_old)/PUMP(3)%time_step)>193.) then
- !! PUMP(3)%N_ref =(193.*PUMP(3)%time_step)+PUMP(3)%N_old
- !! else if (((PUMP(3)%N_old-PUMP(3)%N_new)/PUMP(3)%time_step)>193.) then
- !! PUMP(3)%N_ref = (-193.*PUMP(3)%time_step)+PUMP(3)%N_old
- !! else
- !! PUMP(3)%N_ref = PUMP(3)%N_new
- !! end if
- !!
- !! Call Pump3_OnMode_Solver
- !!
- !! IF (PUMP(3)%Flow_Rate>0.) Then
- !! Call OpenCementPump()
- !! Else
- !! Call CloseCementPump()
- !! End if
- !!
- !! PUMP(3)%N_old = PUMP(3)%N_ref
- !!
- !! Call DATE_AND_TIME(values=MP_END_TIME)
- !! 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))
- !! !print*, 'MPtime=', MP_SolDuration
- !! if(MP_SolDuration > 0.0) then
- !! Call sleepqq(MP_SolDuration)
- !! end if
- !!
- !! if ((MP1CPSwitch==0) .or. (IsStopped == .true.)) then
- !! Call Pump3_OffMode_Solver
- !! Call CloseCementPump()
- !! exit loop2
- !! end if
- !! end do loop2
- !
- ! else
- !
- ! !Call Pump3_OffMode_Solver
- ! !Call CloseCementPump()
- !
- ! end if
- !
- ! if (IsStopped == .true.) then
- ! exit loop1
- ! end if
- !
- !end do loop1
-
-
- end subroutine Pump3MainBody
-
- end module PumpsMain
|