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.
 
 
 
 
 
 

65 lines
1.9 KiB

  1. module CChokeManifoldVariables
  2. use CManifolds
  3. implicit none
  4. public
  5. ! Input vars
  6. logical :: ChokeManifoldValve1
  7. logical :: ChokeManifoldValve2
  8. real(8) :: LeftManualChoke
  9. logical :: ChokeManifoldValve4
  10. logical :: ChokeManifoldValve5
  11. real(8) :: RightManualChoke
  12. logical :: ChokeManifoldValve7
  13. logical :: ChokeManifoldValve8
  14. logical :: ChokeManifoldValve9
  15. logical :: ChokeManifoldValve10
  16. logical :: ChokeManifoldValve11
  17. logical :: ChokeManifoldValve12
  18. logical :: ChokeManifoldValve13
  19. ! Output vars
  20. integer :: HydraulicChock1
  21. integer :: HydraulicChock2
  22. ! Control vars
  23. logical :: HyChock1OnProblem = .false.
  24. logical :: HyChock2OnProblem = .false.
  25. logical :: LeftManChokeOnProblem = .false.
  26. logical :: RightManChokeOnProblem = .false.
  27. contains
  28. subroutine SetHydraulicChock1(v)
  29. implicit none
  30. integer, intent(in) :: v
  31. HydraulicChock1 = v
  32. if(HyChock1OnProblem) then
  33. call ChangeValve(33, .true.)
  34. else
  35. if(v == 100) then
  36. if(Valve(33)%Status) call ChangeValve(33, .false.)
  37. else
  38. if(.not.Valve(33)%Status) call ChangeValve(33, .true.)
  39. endif
  40. endif
  41. !WRITE (*,*) ' valve 33 ', Valve(33)%Status, ' arg ', v
  42. end subroutine
  43. subroutine SetHydraulicChock2(v)
  44. implicit none
  45. integer, intent(in) :: v
  46. HydraulicChock2 = v
  47. if(HyChock2OnProblem) then
  48. call ChangeValve(34, .true.)
  49. else
  50. if(v==100) then
  51. if(Valve(34)%Status) call ChangeValve(34, .false.)
  52. else
  53. if(.not.Valve(34)%Status) call ChangeValve(34, .true.)
  54. endif
  55. endif
  56. !WRITE (*,*) ' valve 34 ', Valve(34)%Status, ' arg ', v
  57. end subroutine
  58. endmodule CChokeManifoldVariables