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.

CBopStack.f90 5.2 KiB

1 year ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. module CBopStack
  2. use SimulationVariables
  3. use json_module
  4. implicit none
  5. public
  6. contains
  7. subroutine BopStackFromJson(parent)
  8. use json_module,IK =>json_ik
  9. type(json_value),pointer :: parent
  10. type(json_core) :: json
  11. type(json_value),pointer :: p,pitem,pval
  12. logical::is_found
  13. integer::i,n_children
  14. CHARACTER(KIND=JSON_CK, LEN=:), ALLOCATABLE :: val
  15. call json%get(parent,'BopStack',p)
  16. call json%get(p,'AboveAnnularHeight',pval)
  17. call json%get(pval,data%Configuration%BopStack%AboveAnnularHeight)
  18. call json%get(p,'AnnularPreventerHeight',pval)
  19. call json%get(pval,data%Configuration%BopStack%AnnularPreventerHeight)
  20. call json%get(p,'UpperRamHeight',pval)
  21. call json%get(pval,data%Configuration%BopStack%UpperRamHeight)
  22. call json%get(p,'LowerRamHeight',pval)
  23. call json%get(pval,data%Configuration%BopStack%LowerRamHeight)
  24. call json%get(p,'BlindRamHeight',pval)
  25. call json%get(pval,data%Configuration%BopStack%BlindRamHeight)
  26. call json%get(p,'KillHeight',pval)
  27. call json%get(pval,data%Configuration%BopStack%KillHeight)
  28. call json%get(p,'KillOpen',pval)
  29. call json%get(pval,data%Configuration%BopStack%KillOpen)
  30. call json%get(p,'KillClose',pval)
  31. call json%get(pval,data%Configuration%BopStack%KillClose)
  32. call json%get(p,'GroundLevel',pval)
  33. call json%get(pval,data%Configuration%BopStack%GroundLevel)
  34. call json%get(p,'LowerRamOpen',pval)
  35. call json%get(pval,data%Configuration%BopStack%LowerRamOpen)
  36. call json%get(p,'LowerRamClose',pval)
  37. call json%get(pval,data%Configuration%BopStack%LowerRamClose)
  38. call json%get(p,'ChokeOpen',pval)
  39. call json%get(pval,data%Configuration%BopStack%ChokeOpen)
  40. call json%get(p,'ChokeClose',pval)
  41. call json%get(pval,data%Configuration%BopStack%ChokeClose)
  42. call json%get(p,'BlindRamOpen',pval)
  43. call json%get(pval,data%Configuration%BopStack%BlindRamOpen)
  44. call json%get(p,'BlindRamClose',pval)
  45. call json%get(pval,data%Configuration%BopStack%BlindRamClose)
  46. call json%get(p,'UpperRamOpen',pval)
  47. call json%get(pval,data%Configuration%BopStack%UpperRamOpen)
  48. call json%get(p,'UpperRamClose',pval)
  49. call json%get(pval,data%Configuration%BopStack%UpperRamClose)
  50. call json%get(p,'AnnularPreventerOpen',pval)
  51. call json%get(pval,data%Configuration%BopStack%AnnularPreventerOpen)
  52. call json%get(p,'AnnularPreventerClose',pval)
  53. call json%get(pval,data%Configuration%BopStack%AnnularPreventerClose)
  54. call json%get(p,'RamStringDrag',pval)
  55. call json%get(pval,data%Configuration%BopStack%RamStringDrag)
  56. call json%get(p,'AnnularStringDrag',pval)
  57. call json%get(pval,data%Configuration%BopStack%AnnularStringDrag)
  58. call json%get(p,'ChokeLineLength',pval)
  59. call json%get(pval,data%Configuration%BopStack%ChokeLineLength)
  60. call json%get(p,'ChokeLineId',pval)
  61. call json%get(pval,data%Configuration%BopStack%ChokeLineId)
  62. end subroutine
  63. subroutine BopStackToJson(parent)
  64. type(json_value),pointer :: parent
  65. type(json_core) :: json
  66. type(json_value),pointer :: p
  67. ! 1. create new node
  68. call json%create_object(p,'BopStack')
  69. ! 2. add member of data type to new node
  70. call json%add(p,"AboveAnnularHeight",data%Configuration%BopStack%AboveAnnularHeight)
  71. call json%add(p,"AnnularPreventerClose",data%Configuration%BopStack%AnnularPreventerClose)
  72. call json%add(p,"AnnularPreventerHeight",data%Configuration%BopStack%AnnularPreventerHeight)
  73. call json%add(p,"AnnularPreventerOpen",data%Configuration%BopStack%AnnularPreventerOpen)
  74. call json%add(p,"AnnularStringDrag",data%Configuration%BopStack%AnnularStringDrag)
  75. call json%add(p,"BlindRamClose",data%Configuration%BopStack%BlindRamClose)
  76. call json%add(p,"BlindRamHeight",data%Configuration%BopStack%BlindRamHeight)
  77. call json%add(p,"BlindRamOpen",data%Configuration%BopStack%BlindRamOpen)
  78. call json%add(p,"ChokeClose",data%Configuration%BopStack%ChokeClose)
  79. call json%add(p,"ChokeLineId",data%Configuration%BopStack%ChokeLineId)
  80. call json%add(p,"ChokeLineLength",data%Configuration%BopStack%ChokeLineLength)
  81. call json%add(p,"ChokeOpen",data%Configuration%BopStack%ChokeOpen)
  82. call json%add(p,"GroundLevel",data%Configuration%BopStack%GroundLevel)
  83. call json%add(p,"KillClose",data%Configuration%BopStack%KillClose)
  84. call json%add(p,"KillHeight",data%Configuration%BopStack%KillHeight)
  85. call json%add(p,"KillOpen",data%Configuration%BopStack%KillOpen)
  86. call json%add(p,"LowerRamClose",data%Configuration%BopStack%LowerRamClose)
  87. call json%add(p,"LowerRamHeight",data%Configuration%BopStack%LowerRamHeight)
  88. call json%add(p,"LowerRamOpen",data%Configuration%BopStack%LowerRamOpen)
  89. call json%add(p,"RamStringDrag",data%Configuration%BopStack%RamStringDrag)
  90. call json%add(p,"UpperRamClose",data%Configuration%BopStack%UpperRamClose)
  91. call json%add(p,"UpperRamHeight",data%Configuration%BopStack%UpperRamHeight)
  92. call json%add(p,"UpperRamOpen",data%Configuration%BopStack%UpperRamOpen)
  93. ! 3. add new node to parent
  94. call json%add(parent,p)
  95. end subroutine
  96. end module CBopStack