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.
 
 
 
 
 
 

76 lines
2.8 KiB

  1. module CLostProblems
  2. use SimulationVariables
  3. implicit none
  4. public
  5. contains
  6. subroutine LostProblemsFromJson(parent)
  7. type(json_value),pointer :: parent
  8. type(json_core) :: json
  9. type(json_value),pointer :: p,pval
  10. call json%get(parent,'LostProblems',p)
  11. call ProblemFromJson(p,"LostCirculation",data%problems%LostProblems%LostCirculation)
  12. call json%get(p,'FlowRate',pval)
  13. call json%get(pval,data%problems%LostProblems%FlowRate)
  14. end subroutine
  15. subroutine LostProblemsToJson(parent)
  16. type(json_value),pointer :: parent
  17. type(json_core) :: json
  18. type(json_value),pointer :: p
  19. ! 1. create new node
  20. call json%create_object(p,'LostProblems')
  21. ! 2. add member of data type to new node
  22. call ProblemToJson(p,"LostCirculation",data%problems%LostProblems%LostCirculation)
  23. call json%add(p,"FlowRate",data%problems%LostProblems%FlowRate)
  24. ! 3. add new node to parent
  25. call json%add(parent,p)
  26. end subroutine
  27. subroutine ProcessLostProblemsDueTime(time)
  28. implicit none
  29. integer :: time
  30. if(data%problems%LostProblems%LostCirculation%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%LostProblems%LostCirculation, ChangeLostCirculation, time)
  31. end subroutine
  32. subroutine ProcessLostProblemsDuePumpStrokes(strokes)
  33. implicit none
  34. integer :: strokes
  35. if(data%problems%LostProblems%LostCirculation%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%LostProblems%LostCirculation, ChangeLostCirculation, strokes)
  36. end subroutine
  37. subroutine ProcessLostProblemsDueVolumePumped(volume)
  38. implicit none
  39. real(8) :: volume
  40. if(data%problems%LostProblems%LostCirculation%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%LostProblems%LostCirculation, ChangeLostCirculation, volume)
  41. end subroutine
  42. subroutine ProcessLostProblemsDueDistanceDrilled(distance)
  43. implicit none
  44. real(8) :: distance
  45. if(data%problems%LostProblems%LostCirculation%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%LostProblems%LostCirculation, ChangeLostCirculation, distance)
  46. end subroutine
  47. subroutine ChangeLostCirculation(status)
  48. implicit none
  49. integer, intent (in) :: status
  50. ! if(associated(LostCirculationPtr)) call LostCirculationPtr(status)
  51. !if(status == Clear_StatusType) if(print_log) print*,'On_LostCirculation_Clear'
  52. !if(status == Executed_StatusType) if(print_log) print*,'On_LostCirculation_Execute'
  53. endsubroutine
  54. end module CLostProblems