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.
 
 
 
 
 
 

86 lines
4.1 KiB

  1. module DrillingWatchModule
  2. use SimulationVariables
  3. contains
  4. ! subroutine DrillingWatchFromJson(parent)
  5. ! type(json_value),pointer :: parent
  6. ! type(json_core) :: json
  7. ! type(json_value),pointer :: p,pval
  8. ! logical::is_found
  9. ! ! 1. get related root
  10. ! call json%get(parent,'DrillingWatch',p)
  11. ! ! 2. get member of data type from node
  12. ! call json%get(p,'Depth',pval)
  13. ! call json%get(pval,data%Equipments%DrillingWatch%Depth)
  14. ! call json%get(p,'BitPosition',pval)
  15. ! call json%get(pval,data%Equipments%DrillingWatch%BitPosition)
  16. ! call json%get(p,'HookLoad',pval)
  17. ! call json%get(pval,data%Equipments%DrillingWatch%HookLoad)
  18. ! call json%get(p,'WeightOnBit',pval)
  19. ! call json%get(pval,data%Equipments%DrillingWatch%WeightOnBit)
  20. ! call json%get(p,'RPM',pval)
  21. ! call json%get(pval,data%Equipments%DrillingWatch%RPM)
  22. ! call json%get(p,'ROP',pval)
  23. ! call json%get(pval,data%Equipments%DrillingWatch%ROP)
  24. ! call json%get(p,'Torque',pval)
  25. ! call json%get(pval,data%Equipments%DrillingWatch%Torque)
  26. ! call json%get(p,'PumpPressure',pval)
  27. ! call json%get(pval,data%Equipments%DrillingWatch%PumpPressure)
  28. ! call json%get(p,'SPM1',pval)
  29. ! call json%get(pval,data%Equipments%DrillingWatch%SPM1)
  30. ! call json%get(p,'SPM2',pval)
  31. ! call json%get(pval,data%Equipments%DrillingWatch%SPM2)
  32. ! call json%get(p,'CasingPressure',pval)
  33. ! call json%get(pval,data%Equipments%DrillingWatch%CasingPressure)
  34. ! call json%get(p,'PercentFlow',pval)
  35. ! call json%get(pval,data%Equipments%DrillingWatch%PercentFlow)
  36. ! call json%get(p,'PitGainLose',pval)
  37. ! call json%get(pval,data%Equipments%DrillingWatch%PitGainLose)
  38. ! call json%get(p,'PitVolume',pval)
  39. ! call json%get(pval,data%Equipments%DrillingWatch%PitVolume)
  40. ! call json%get(p,'KillMudVolume',pval)
  41. ! call json%get(pval,data%Equipments%DrillingWatch%KillMudVolume)
  42. ! call json%get(p,'TripTankVolume',pval)
  43. ! call json%get(pval,data%Equipments%DrillingWatch%TripTankVolume)
  44. ! call json%get(p,'MudWeightIn',pval)
  45. ! call json%get(pval,data%Equipments%DrillingWatch%MudWeightIn)
  46. ! call json%get(p,'FillVolume',pval)
  47. ! call json%get(pval,data%Equipments%DrillingWatch%FillVolume)
  48. ! call json%get(p,'MudWeightOut',pval)
  49. ! call json%get(pval,data%Equipments%DrillingWatch%MudWeightOut)
  50. ! end subroutine
  51. subroutine DrillingWatchToJson(parent)
  52. type(json_value),pointer :: parent
  53. type(json_core) :: json
  54. type(json_value),pointer :: p
  55. ! 1. create new node
  56. call json%create_object(p,'DrillingWatch')
  57. call json%add(p,"Depth",data%Equipments%DrillingWatch%Depth)
  58. call json%add(p,"BitPosition",data%Equipments%DrillingWatch%BitPosition)
  59. call json%add(p,"HookLoad",data%Equipments%DrillingWatch%HookLoad)
  60. call json%add(p,"WeightOnBit",data%Equipments%DrillingWatch%WeightOnBit)
  61. call json%add(p,"RPM",data%Equipments%DrillingWatch%RPM)
  62. call json%add(p,"ROP",data%Equipments%DrillingWatch%ROP)
  63. call json%add(p,"Torque",data%Equipments%DrillingWatch%Torque)
  64. call json%add(p,"PumpPressure",data%Equipments%DrillingWatch%PumpPressure)
  65. call json%add(p,"SPM1",data%Equipments%DrillingWatch%SPM1)
  66. call json%add(p,"SPM2",data%Equipments%DrillingWatch%SPM2)
  67. call json%add(p,"CasingPressure",data%Equipments%DrillingWatch%CasingPressure)
  68. call json%add(p,"PercentFlow",data%Equipments%DrillingWatch%PercentFlow)
  69. call json%add(p,"PitGainLose",data%Equipments%DrillingWatch%PitGainLose)
  70. call json%add(p,"PitVolume",data%Equipments%DrillingWatch%PitVolume)
  71. call json%add(p,"KillMudVolume",data%Equipments%DrillingWatch%KillMudVolume)
  72. call json%add(p,"TripTankVolume",data%Equipments%DrillingWatch%TripTankVolume)
  73. call json%add(p,"MudWeightIn",data%Equipments%DrillingWatch%MudWeightIn)
  74. call json%add(p,"FillVolume",data%Equipments%DrillingWatch%FillVolume)
  75. call json%add(p,"MudWeightOut",data%Equipments%DrillingWatch%MudWeightOut)
  76. call json%add(parent,p)
  77. end subroutine
  78. end module DrillingWatchModule