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.

CChokeManifold.f90 3.4 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. module CChokeManifold
  2. ! use CChokeManifoldVariables
  3. use SimulationVariables
  4. use CManifolds
  5. use CLog2
  6. implicit none
  7. public
  8. contains
  9. subroutine ChokeManifoldToJson(parent)
  10. type(json_value),pointer :: parent
  11. type(json_core) :: json
  12. type(json_value),pointer :: p
  13. ! 1. create new node
  14. call json%create_object(p,'ChokeManifold')
  15. call json%add(p,"ChokeManifoldValve1",data%EquipmentControl%ChokeManifold%ChokeManifoldValve1)
  16. call json%add(p,"ChokeManifoldValve2",data%EquipmentControl%ChokeManifold%ChokeManifoldValve2)
  17. call json%add(p,"LeftManualChoke",data%EquipmentControl%ChokeManifold%LeftManualChoke)
  18. call json%add(p,"ChokeManifoldValve4",data%EquipmentControl%ChokeManifold%ChokeManifoldValve4)
  19. call json%add(p,"ChokeManifoldValve5",data%EquipmentControl%ChokeManifold%ChokeManifoldValve5)
  20. call json%add(p,"RightManualChoke",data%EquipmentControl%ChokeManifold%RightManualChoke)
  21. call json%add(p,"ChokeManifoldValve7",data%EquipmentControl%ChokeManifold%ChokeManifoldValve7)
  22. call json%add(p,"ChokeManifoldValve8",data%EquipmentControl%ChokeManifold%ChokeManifoldValve8)
  23. call json%add(p,"ChokeManifoldValve9",data%EquipmentControl%ChokeManifold%ChokeManifoldValve9)
  24. call json%add(p,"ChokeManifoldValve10",data%EquipmentControl%ChokeManifold%ChokeManifoldValve10)
  25. call json%add(p,"ChokeManifoldValve11",data%EquipmentControl%ChokeManifold%ChokeManifoldValve11)
  26. call json%add(p,"ChokeManifoldValve12",data%EquipmentControl%ChokeManifold%ChokeManifoldValve12)
  27. call json%add(p,"ChokeManifoldValve13",data%EquipmentControl%ChokeManifold%ChokeManifoldValve13)
  28. call json%add(p,"HydraulicChock1",data%EquipmentControl%ChokeManifold%HydraulicChock1)
  29. call json%add(p,"HydraulicChock2",data%EquipmentControl%ChokeManifold%HydraulicChock2)
  30. call json%add(p,"HyChock1OnProblem",data%EquipmentControl%ChokeManifold%HyChock1OnProblem)
  31. call json%add(p,"HyChock2OnProblem",data%EquipmentControl%ChokeManifold%HyChock2OnProblem)
  32. call json%add(p,"LeftManChokeOnProblem",data%EquipmentControl%ChokeManifold%LeftManChokeOnProblem)
  33. call json%add(p,"RightManChokeOnProblem",data%EquipmentControl%ChokeManifold%RightManChokeOnProblem)
  34. call json%add(parent,p)
  35. end subroutine
  36. subroutine SetHydraulicChock1(v)
  37. implicit none
  38. integer, intent(in) :: v
  39. data%EquipmentControl%ChokeManifold%HydraulicChock1 = v
  40. if(data%EquipmentControl%ChokeManifold%HyChock1OnProblem) then
  41. call ChangeValve(33, .true.)
  42. else
  43. if(v == 100) then
  44. if(Manifold%Valve(33)%Status) call ChangeValve(33, .false.)
  45. else
  46. if(.not.Manifold%Valve(33)%Status) call ChangeValve(33, .true.)
  47. endif
  48. endif
  49. !WRITE (*,*) ' valve 33 ', Valve(33)%Status, ' arg ', v
  50. end subroutine
  51. subroutine SetHydraulicChock2(v)
  52. implicit none
  53. integer, intent(in) :: v
  54. data%EquipmentControl%ChokeManifold%HydraulicChock2 = v
  55. if(data%EquipmentControl%ChokeManifold%HyChock2OnProblem) then
  56. call ChangeValve(34, .true.)
  57. else
  58. if(v==100) then
  59. if(Manifold%Valve(34)%Status) call ChangeValve(34, .false.)
  60. else
  61. if(.not.Manifold%Valve(34)%Status) call ChangeValve(34, .true.)
  62. endif
  63. endif
  64. !WRITE (*,*) ' valve 34 ', Valve(34)%Status, ' arg ', v
  65. end subroutine
  66. end module CChokeManifold