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.
 
 
 
 
 
 

120 lines
6.6 KiB

  1. module CMudTreatmentProblems
  2. use SimulationVariables
  3. implicit none
  4. public
  5. contains
  6. subroutine MudTreatmentProblemsFromJson(parent)
  7. type(json_value),pointer :: parent
  8. type(json_core) :: json
  9. type(json_value),pointer :: p
  10. call json%get(parent,'MudTreatmentProblems',p)
  11. call ProblemFromJson(p,"Degasser",data%problems%MudTreatmentProblems%Degasser)
  12. call ProblemFromJson(p,"ShaleShaker",data%problems%MudTreatmentProblems%ShaleShaker)
  13. call ProblemFromJson(p,"Desander",data%problems%MudTreatmentProblems%Desander)
  14. call ProblemFromJson(p,"Desilter",data%problems%MudTreatmentProblems%Desilter)
  15. end subroutine
  16. subroutine MudTreatmentProblemsToJson(parent)
  17. type(json_value),pointer :: parent
  18. type(json_core) :: json
  19. type(json_value),pointer :: p
  20. ! 1. create new node
  21. call json%create_object(p,'MudTreatmentProblems')
  22. ! 2. add member of data type to new node
  23. call ProblemToJson(p,"Degasser",data%problems%MudTreatmentProblems%Degasser)
  24. call ProblemToJson(p,"ShaleShaker",data%problems%MudTreatmentProblems%ShaleShaker)
  25. call ProblemToJson(p,"Desander",data%problems%MudTreatmentProblems%Desander)
  26. call ProblemToJson(p,"Desilter",data%problems%MudTreatmentProblems%Desilter)
  27. ! 3. add new node to parent
  28. call json%add(parent,p)
  29. end subroutine
  30. subroutine ProcessMudTreatmentProblemsDueTime(time)
  31. implicit none
  32. integer :: time
  33. if(data%problems%MudTreatmentProblems%Degasser%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%MudTreatmentProblems%Degasser, ChangeDegasser, time)
  34. if(data%problems%MudTreatmentProblems%ShaleShaker%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%MudTreatmentProblems%ShaleShaker, ChangeShaleShaker, time)
  35. if(data%problems%MudTreatmentProblems%Desander%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%MudTreatmentProblems%Desander, ChangeDesander, time)
  36. if(data%problems%MudTreatmentProblems%Desilter%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%MudTreatmentProblems%Desilter, ChangeDesilter, time)
  37. end subroutine
  38. subroutine ProcessMudTreatmentProblemsDuePumpStrokes(strokes)
  39. implicit none
  40. integer :: strokes
  41. if(data%problems%MudTreatmentProblems%Degasser%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%MudTreatmentProblems%Degasser, ChangeDegasser, strokes)
  42. if(data%problems%MudTreatmentProblems%ShaleShaker%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%MudTreatmentProblems%ShaleShaker, ChangeShaleShaker, strokes)
  43. if(data%problems%MudTreatmentProblems%Desander%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%MudTreatmentProblems%Desander, ChangeDesander, strokes)
  44. if(data%problems%MudTreatmentProblems%Desilter%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%MudTreatmentProblems%Desilter, ChangeDesilter, strokes)
  45. end subroutine
  46. subroutine ProcessMudTreatmentProblemsDueVolumePumped(volume)
  47. implicit none
  48. real(8) :: volume
  49. if(data%problems%MudTreatmentProblems%Degasser%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%MudTreatmentProblems%Degasser, ChangeDegasser, volume)
  50. if(data%problems%MudTreatmentProblems%ShaleShaker%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%MudTreatmentProblems%ShaleShaker, ChangeShaleShaker, volume)
  51. if(data%problems%MudTreatmentProblems%Desander%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%MudTreatmentProblems%Desander, ChangeDesander, volume)
  52. if(data%problems%MudTreatmentProblems%Desilter%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%MudTreatmentProblems%Desilter, ChangeDesilter, volume)
  53. end subroutine
  54. subroutine ProcessMudTreatmentProblemsDueDistanceDrilled(distance)
  55. implicit none
  56. real(8) :: distance
  57. if(data%problems%MudTreatmentProblems%Degasser%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%MudTreatmentProblems%Degasser, ChangeDegasser, distance)
  58. if(data%problems%MudTreatmentProblems%ShaleShaker%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%MudTreatmentProblems%ShaleShaker, ChangeShaleShaker, distance)
  59. if(data%problems%MudTreatmentProblems%Desander%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%MudTreatmentProblems%Desander, ChangeDesander, distance)
  60. if(data%problems%MudTreatmentProblems%Desilter%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%MudTreatmentProblems%Desilter, ChangeDesilter, distance)
  61. end subroutine
  62. subroutine ChangeDegasser(status)
  63. implicit none
  64. integer, intent (in) :: status
  65. !if(associated(DegasserPtr)) call DegasserPtr(status)
  66. !if(status == Clear_StatusType) if(print_log) print*,'On_Degasser_Clear'
  67. !if(status == Executed_StatusType) if(print_log) print*,'On_Degasser_Execute'
  68. endsubroutine
  69. subroutine ChangeShaleShaker(status)
  70. implicit none
  71. integer, intent (in) :: status
  72. !if(associated(ShaleShakerPtr)) call ShaleShakerPtr(status)
  73. !if(status == Clear_StatusType) if(print_log) print*,'On_ShaleShaker_Clear'
  74. !if(status == Executed_StatusType) if(print_log) print*,'On_ShaleShaker_Execute'
  75. endsubroutine
  76. subroutine ChangeDesander(status)
  77. implicit none
  78. integer, intent (in) :: status
  79. !if(associated(DesanderPtr)) call DesanderPtr(status)
  80. !if(status == Clear_StatusType) if(print_log) print*,'On_Desander_Clear'
  81. !if(status == Executed_StatusType) if(print_log) print*,'On_Desander_Execute'
  82. endsubroutine
  83. subroutine ChangeDesilter(status)
  84. implicit none
  85. integer, intent (in) :: status
  86. !if(associated(DesilterPtr)) call DesilterPtr(status)
  87. !if(status == Clear_StatusType) if(print_log) print*,'On_Desilter_Clear'
  88. !if(status == Executed_StatusType) if(print_log) print*,'On_Desilter_Execute'
  89. endsubroutine
  90. end module CMudTreatmentProblems