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.
 
 
 
 
 
 

68 lines
2.2 KiB

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