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.
 
 
 
 
 
 

98 lines
6.2 KiB

  1. module CDrillStemProblems
  2. use SimulationVariables
  3. implicit none
  4. public
  5. contains
  6. subroutine DrillStemProblemsFromJson(parent)
  7. type(json_value),pointer :: parent
  8. type(json_core) :: json
  9. type(json_value),pointer :: p,pval
  10. call json%get(parent,'DrillStemProblems',p)
  11. call ProblemFromJson(p,"StringDragIncrease",data%problems%DrillStemProblems%StringDragIncrease)
  12. call ProblemFromJson(p,"StringTorqueIncrease",data%problems%DrillStemProblems%StringTorqueIncrease)
  13. call ProblemFromJson(p,"StringTorqueFluctuation",data%problems%DrillStemProblems%StringTorqueFluctuation)
  14. call json%get(p,'StringDragIncreaseTime',pval)
  15. call json%get(pval,data%problems%DrillStemProblems%StringDragIncreaseTime)
  16. call json%get(p,'StringTorqueIncreaseTime',pval)
  17. call json%get(pval,data%problems%DrillStemProblems%StringTorqueIncreaseTime)
  18. end subroutine
  19. subroutine DrillStemProblemsToJson(parent)
  20. type(json_value),pointer :: parent
  21. type(json_core) :: json
  22. type(json_value),pointer :: p
  23. ! 1. create new node
  24. call json%create_object(p,'DrillStemsProblems')
  25. ! 2. add member of data type to new node
  26. call ProblemToJson(p,"StringDragIncrease",data%problems%DrillStemProblems%StringDragIncrease)
  27. call ProblemToJson(p,"StringTorqueIncrease",data%problems%DrillStemProblems%StringTorqueIncrease)
  28. call ProblemToJson(p,"StringTorqueFluctuation",data%problems%DrillStemProblems%StringTorqueFluctuation)
  29. call json%add(p,"StringDragIncreaseTime",data%problems%DrillStemProblems%StringDragIncreaseTime)
  30. call json%add(p,"StringTorqueIncreaseTime",data%problems%DrillStemProblems%StringTorqueIncreaseTime)
  31. ! 3. add new node to parent
  32. call json%add(parent,p)
  33. end subroutine
  34. subroutine ProcessDrillStemProblemsDueTime(time)
  35. implicit none
  36. integer :: time
  37. if(data%problems%DrillStemProblems%StringDragIncrease%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%DrillStemProblems%StringDragIncrease, ChangeStringDragIncrease, time)
  38. if(data%problems%DrillStemProblems%StringTorqueIncrease%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%DrillStemProblems%StringTorqueIncrease, ChangeStringTorqueIncrease, time)
  39. if(data%problems%DrillStemProblems%StringTorqueFluctuation%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%DrillStemProblems%StringTorqueFluctuation, ChangeStringTorqueFluctuation, time)
  40. end subroutine
  41. subroutine ProcessDrillStemProblemsDuePumpStrokes(strokes)
  42. implicit none
  43. integer :: strokes
  44. if(data%problems%DrillStemProblems%StringDragIncrease%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%DrillStemProblems%StringDragIncrease, ChangeStringDragIncrease, strokes)
  45. if(data%problems%DrillStemProblems%StringTorqueIncrease%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%DrillStemProblems%StringTorqueIncrease, ChangeStringTorqueIncrease, strokes)
  46. if(data%problems%DrillStemProblems%StringTorqueFluctuation%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%DrillStemProblems%StringTorqueFluctuation, ChangeStringTorqueFluctuation, strokes)
  47. end subroutine
  48. subroutine ProcessDrillStemProblemsDueVolumePumped(volume)
  49. implicit none
  50. real(8) :: volume
  51. if(data%problems%DrillStemProblems%StringDragIncrease%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%DrillStemProblems%StringDragIncrease, ChangeStringDragIncrease, volume)
  52. if(data%problems%DrillStemProblems%StringTorqueIncrease%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%DrillStemProblems%StringTorqueIncrease, ChangeStringTorqueIncrease, volume)
  53. if(data%problems%DrillStemProblems%StringTorqueFluctuation%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%DrillStemProblems%StringTorqueFluctuation, ChangeStringTorqueFluctuation, volume)
  54. end subroutine
  55. subroutine ProcessDrillStemProblemsDueDistanceDrilled(distance)
  56. implicit none
  57. real(8) :: distance
  58. if(data%problems%DrillStemProblems%StringDragIncrease%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%DrillStemProblems%StringDragIncrease, ChangeStringDragIncrease, distance)
  59. if(data%problems%DrillStemProblems%StringTorqueIncrease%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%DrillStemProblems%StringTorqueIncrease, ChangeStringTorqueIncrease, distance)
  60. if(data%problems%DrillStemProblems%StringTorqueFluctuation%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%DrillStemProblems%StringTorqueFluctuation, ChangeStringTorqueFluctuation, distance)
  61. end subroutine
  62. subroutine ChangeStringDragIncrease(status)
  63. implicit none
  64. integer, intent (in) :: status
  65. ! if(associated(StringDragIncreasePtr)) call StringDragIncreasePtr(status)
  66. !if(status == Clear_StatusType) if(print_log) print*,'On_StringDragIncrease_Clear'
  67. !if(status == Executed_StatusType) if(print_log) print*,'On_StringDragIncrease_Execute'
  68. endsubroutine
  69. subroutine ChangeStringTorqueIncrease(status)
  70. implicit none
  71. integer, intent (in) :: status
  72. ! if(associated(StringTorqueIncreasePtr)) call StringTorqueIncreasePtr(status)
  73. !if(status == Clear_StatusType) if(print_log) print*,'On_StringTorqueIncrease_Clear'
  74. !if(status == Executed_StatusType) if(print_log) print*,'On_StringTorqueIncrease_Execute'
  75. endsubroutine
  76. subroutine ChangeStringTorqueFluctuation(status)
  77. implicit none
  78. integer, intent (in) :: status
  79. ! if(associated(StringTorqueFluctuationPtr)) call StringTorqueFluctuationPtr(status)
  80. !if(status == Clear_StatusType) if(print_log) print*,'On_StringTorqueFluctuation_Clear'
  81. !if(status == Executed_StatusType) if(print_log) print*,'On_StringTorqueFluctuation_Execute'
  82. endsubroutine
  83. end module CDrillStemProblems