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.

DrillWatch.f90 4.2 KiB

1 year ago
1 year ago
1 year ago
1 year ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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",50)
  69. call json%add(p,"PercentFlow",data%Equipments%DrillingWatch%PercentFlow)
  70. call json%add(p,"PitGainLose",data%Equipments%DrillingWatch%PitGainLose)
  71. call json%add(p,"PitVolume",data%Equipments%DrillingWatch%PitVolume)
  72. call json%add(p,"KillMudVolume",data%Equipments%DrillingWatch%KillMudVolume)
  73. call json%add(p,"TripTankVolume",data%Equipments%DrillingWatch%TripTankVolume)
  74. call json%add(p,"MudWeightIn",data%Equipments%DrillingWatch%MudWeightIn)
  75. call json%add(p,"FillVolume",data%Equipments%DrillingWatch%FillVolume)
  76. call json%add(p,"MudWeightOut",data%Equipments%DrillingWatch%MudWeightOut)
  77. call json%add(parent,p)
  78. end subroutine
  79. end module DrillingWatchModule