Simulation Core
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 
 
 

80 rader
3.7 KiB

  1. module CBitProblems
  2. use SimulationVariables
  3. use json_module
  4. implicit none
  5. public
  6. contains
  7. subroutine BitProblemsToJson(parent)
  8. type(json_value),pointer :: parent
  9. type(json_core) :: json
  10. type(json_value),pointer :: p
  11. ! 1. create new node
  12. call json%create_object(p,'BitProblems')
  13. ! 2. add member of data type to new node
  14. call ProblemToJson(p,"JetWashout",data%problems%BitProblems%JetWashout)
  15. call ProblemToJson(p,"PlugJets",data%problems%BitProblems%PlugJets)
  16. call json%add(p, "JetWashoutCount",data%problems%BitProblems%JetWashoutCount)
  17. call json%add(p, "PlugJetsCount",data%problems%BitProblems%PlugJetsCount)
  18. ! 3. add new node to parent
  19. call json%add(parent,p)
  20. end subroutine
  21. subroutine ProcessBitProblemsDueTime(time)
  22. implicit none
  23. integer :: time
  24. if(data%problems%BitProblems%PlugJets%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%BitProblems%PlugJets, ChangePlugJets, time)
  25. if(data%problems%BitProblems%JetWashout%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%BitProblems%JetWashout, ChangeJetWashout, time)
  26. end subroutine
  27. subroutine ProcessBitProblemsDuePumpStrokes(strokes)
  28. implicit none
  29. integer :: strokes
  30. if(data%problems%BitProblems%PlugJets%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%BitProblems%PlugJets, ChangePlugJets, strokes)
  31. if(data%problems%BitProblems%JetWashout%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%BitProblems%JetWashout, ChangeJetWashout, strokes)
  32. end subroutine
  33. subroutine ProcessBitProblemsDueVolumePumped(volume)
  34. implicit none
  35. real(8) :: volume
  36. if(data%problems%BitProblems%PlugJets%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%BitProblems%PlugJets, ChangePlugJets, volume)
  37. if(data%problems%BitProblems%JetWashout%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%BitProblems%JetWashout, ChangeJetWashout, volume)
  38. end subroutine
  39. subroutine ProcessBitProblemsDueDistanceDrilled(distance)
  40. implicit none
  41. real(8) :: distance
  42. if(data%problems%BitProblems%PlugJets%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%BitProblems%PlugJets, ChangePlugJets, distance)
  43. if(data%problems%BitProblems%JetWashout%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%BitProblems%JetWashout, ChangeJetWashout, distance)
  44. end subroutine
  45. subroutine ChangePlugJets(status)
  46. USE FricPressDropVarsModule
  47. implicit none
  48. integer, intent (in) :: status
  49. ! if(associated(data%problems%BitProblems%PlugJetsPtr)) call data%problems%BitProblems%PlugJetsPtr(status)
  50. if(status == Clear_StatusType) data%State%FricPressDrop%BitJetsPlugged = 0
  51. if(status == Executed_StatusType) data%State%FricPressDrop%BitJetsPlugged = 1
  52. endsubroutine
  53. subroutine ChangeJetWashout(status)
  54. USE FricPressDropVarsModule
  55. implicit none
  56. integer, intent (in) :: status
  57. ! if(associated(data%problems%BitProblems%JetWashoutPtr)) call data%problems%BitProblems%JetWashoutPtr(status)
  58. if(status == Clear_StatusType) data%State%FricPressDrop%BitJetsWashedOut = 0
  59. if(status == Executed_StatusType) data%State%FricPressDrop%BitJetsWashedOut = 1
  60. endsubroutine
  61. end module CBitProblems