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.
 
 
 
 
 
 

108 lines
5.2 KiB

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