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.
 
 
 
 
 
 

81 lines
4.1 KiB

  1. module CCasingLinerChoke
  2. use SimulationVariables
  3. use json_module
  4. implicit none
  5. public
  6. contains
  7. subroutine CasingLinerChokeToJson(parent)
  8. type(json_value),pointer :: parent
  9. type(json_core) :: json
  10. type(json_value),pointer :: p
  11. ! 1. create new node
  12. call json%create_object(p,'CasingLinerChoke')
  13. ! 2. add member of data type to new node
  14. ! call StringConfigurationToJson(p)
  15. ! call FormationToJson(p)
  16. call json%add(p,"CasingDepth",data%Configuration%CasingLinerChoke%CasingDepth)
  17. call json%add(p,"CasingId",data%Configuration%CasingLinerChoke%CasingId)
  18. call json%add(p,"CasingOd",data%Configuration%CasingLinerChoke%CasingOd)
  19. call json%add(p,"CasingWeight",data%Configuration%CasingLinerChoke%CasingWeight)
  20. call json%add(p,"CasingCollapsePressure",data%Configuration%CasingLinerChoke%CasingCollapsePressure)
  21. call json%add(p,"CasingTensileStrength",data%Configuration%CasingLinerChoke%CasingTensileStrength)
  22. call json%add(p,"LinerTopDepth",data%Configuration%CasingLinerChoke%LinerTopDepth)
  23. call json%add(p,"LinerLength",data%Configuration%CasingLinerChoke%LinerLength)
  24. call json%add(p,"LinerId",data%Configuration%CasingLinerChoke%LinerId)
  25. call json%add(p,"LinerOd",data%Configuration%CasingLinerChoke%LinerOd)
  26. call json%add(p,"LinerWeight",data%Configuration%CasingLinerChoke%LinerWeight)
  27. call json%add(p,"LinerCollapsePressure",data%Configuration%CasingLinerChoke%LinerCollapsePressure)
  28. call json%add(p,"LinerTensileStrength",data%Configuration%CasingLinerChoke%LinerTensileStrength)
  29. call json%add(p,"OpenHoleId",data%Configuration%CasingLinerChoke%OpenHoleId)
  30. call json%add(p,"OpenHoleLength",data%Configuration%CasingLinerChoke%OpenHoleLength)
  31. ! 3. add new node to parent
  32. call json%add(parent,p)
  33. end subroutine
  34. subroutine CasingLinerChokeFromJson(parent)
  35. use json_module,IK =>json_ik
  36. type(json_value),pointer :: parent
  37. type(json_core) :: json
  38. type(json_value),pointer :: p,pitem
  39. call json%get(parent,'CasingLinerChoke',p)
  40. call json%get(p,"CasingDepth",pitem)
  41. call json%get(pitem,data%Configuration%CasingLinerChoke%CasingDepth)
  42. call json%get(p,"CasingId",pitem)
  43. call json%get(pitem,data%Configuration%CasingLinerChoke%CasingId)
  44. call json%get(p,"CasingOd",pitem)
  45. call json%get(pitem,data%Configuration%CasingLinerChoke%CasingOd)
  46. call json%get(p,"CasingWeight",pitem)
  47. call json%get(pitem,data%Configuration%CasingLinerChoke%CasingWeight)
  48. call json%get(p,"CasingCollapsePressure",pitem)
  49. call json%get(pitem,data%Configuration%CasingLinerChoke%CasingCollapsePressure)
  50. call json%get(p,"CasingTensileStrength",pitem)
  51. call json%get(pitem,data%Configuration%CasingLinerChoke%CasingTensileStrength)
  52. call json%get(p,"LinerTopDepth",pitem)
  53. call json%get(pitem,data%Configuration%CasingLinerChoke%LinerTopDepth)
  54. call json%get(p,"LinerLength",pitem)
  55. call json%get(pitem,data%Configuration%CasingLinerChoke%LinerLength)
  56. call json%get(p,"LinerId",pitem)
  57. call json%get(pitem,data%Configuration%CasingLinerChoke%LinerId)
  58. call json%get(p,"LinerOd",pitem)
  59. call json%get(pitem,data%Configuration%CasingLinerChoke%LinerOd)
  60. call json%get(p,"LinerWeight",pitem)
  61. call json%get(pitem,data%Configuration%CasingLinerChoke%LinerWeight)
  62. call json%get(p,"LinerCollapsePressure",pitem)
  63. call json%get(pitem,data%Configuration%CasingLinerChoke%LinerCollapsePressure)
  64. call json%get(p,"LinerTensileStrength",pitem)
  65. call json%get(pitem,data%Configuration%CasingLinerChoke%LinerTensileStrength)
  66. call json%get(p,"OpenHoleId",pitem)
  67. call json%get(pitem,data%Configuration%CasingLinerChoke%OpenHoleId)
  68. call json%get(p,"OpenHoleLength",pitem)
  69. call json%get(pitem,data%Configuration%CasingLinerChoke%OpenHoleLength)
  70. end subroutine
  71. end module CCasingLinerChoke