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.
 
 
 
 
 
 

87 lines
2.7 KiB

  1. module ChokeControlMain
  2. use CHOKEVARIABLES
  3. implicit none
  4. public
  5. contains
  6. ! subroutine ChokeControl_Setup()
  7. ! ! use CSimulationVariables
  8. ! implicit none
  9. ! call OnSimulationInitialization%Add(ChokeControl_Init)
  10. ! call OnSimulationStop%Add(ChokeControl_Init)
  11. ! call OnChokeControlStep%Add(ChokeControl_Step)
  12. ! call OnChokeControlOutput%Add(ChokeControl_Output)
  13. ! call OnChokeControlMain%Add(ChokeControlMainBody)
  14. ! end subroutine
  15. subroutine ChokeControl_Init
  16. call Choke_StartUp
  17. end subroutine ChokeControl_Init
  18. subroutine ChokeControl_Step
  19. use ChokeModule
  20. implicit none
  21. INTEGER CHNUMBER
  22. IF(ChokeControlPanel%ChokeSelectorSwitch== 1) THEN
  23. ChokeControlPanel%Choke1LED=1
  24. ChokeControlPanel%Choke2LED=0
  25. CHNUMBER=1
  26. ELSE
  27. ChokeControlPanel%Choke2LED=1
  28. ChokeControlPanel%Choke1LED=0
  29. CHNUMBER=2
  30. ENDIF
  31. if(ABS(ChokeControlPanel%ChokeControlLever)==1.0 .AND. ChokeControlPanel%ChokePanelRigAirSwitch == 1 .AND. CHOOKE(CHNUMBER)%FailMalf==0 .AND. AirDrivenPump%ChokeAirFail==0) then
  32. if (ChokeControlPanel%ChokeControlLever == 1.0) then
  33. CHOOKE(CHNUMBER)%ChokeIsClosing = .true.
  34. CHOOKE(CHNUMBER)%ChokeIsOpening = .false.
  35. endif
  36. if (ChokeControlPanel%ChokeControlLever == -1.0) then
  37. CHOOKE(CHNUMBER)%ChokeIsOpening = .true.
  38. CHOOKE(CHNUMBER)%ChokeIsClosing = .false.
  39. endif
  40. AirPumpLine%TIME=AirPumpLine%TIME+AirPumpLine%DeltaT_Choke !overal time (s)
  41. call airpump_code_CHOKE(CHNUMBER)
  42. else
  43. call CHOKE_MainBody2()
  44. endif
  45. end subroutine ChokeControl_Step
  46. ! subroutine ChokeControl_Output
  47. ! implicit none
  48. ! end subroutine ChokeControl_Output
  49. ! subroutine ChokeControlMainBody
  50. ! use CRigSizeVariables
  51. ! use CHOKE
  52. ! implicit none
  53. ! CALL Choke_StartUp()
  54. ! loop1: DO
  55. ! CALL CHOKE_MainBody
  56. ! call sleepqq(100)
  57. ! !IF (IsStopped==.true.) THEN
  58. ! ! EXIT loop1
  59. ! !ENDIF
  60. ! !write(*,*) '1111111111111'
  61. ! if(IsStopped) then
  62. ! !write(*,*) '22222222222222'
  63. ! CALL DEALLOCATE_ARRAYS_CHOKE()
  64. ! !write(*,*) '333333333'
  65. ! call Quit()
  66. ! end if
  67. ! ENDDO loop1
  68. ! CLOSE(150)
  69. ! !CALL DEALLOCATE_ARRAYS_CHOKE()
  70. ! end subroutine ChokeControlMainBody
  71. end module ChokeControlMain