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.
 
 
 
 
 
 

155 regels
8.1 KiB

  1. module MudPropertiesModule
  2. use SimulationVariables
  3. use json_module
  4. implicit none
  5. contains
  6. subroutine MudPropertiesToJson(parent)
  7. type(json_value),pointer :: parent
  8. type(json_core) :: json
  9. type(json_value),pointer :: p
  10. ! 1. create new node
  11. call json%create_object(p,'Mud')
  12. ! 2. add member of data type to new node
  13. call json%add(p,"ActiveMudType",data%Configuration%Mud%ActiveMudType)
  14. call json%add(p,"ActiveRheologyModel",data%Configuration%Mud%ActiveRheologyModel)
  15. call json%add(p,"ActiveMudVolume",data%Configuration%Mud%ActiveMudVolume)
  16. call json%add(p,"ActiveMudVolumeGal",data%Configuration%Mud%ActiveMudVolumeGal)
  17. call json%add(p,"ActiveDensity",data%Configuration%Mud%ActiveDensity)
  18. call json%add(p,"ActivePlasticViscosity",data%Configuration%Mud%ActivePlasticViscosity)
  19. call json%add(p,"ActiveYieldPoint",data%Configuration%Mud%ActiveYieldPoint)
  20. call json%add(p,"ActiveThetaThreeHundred",data%Configuration%Mud%ActiveThetaThreeHundred)
  21. call json%add(p,"ActiveThetaSixHundred",data%Configuration%Mud%ActiveThetaSixHundred)
  22. call json%add(p,"ReserveMudType",data%Configuration%Mud%ReserveMudType)
  23. call json%add(p,"ReserveMudVolume",data%Configuration%Mud%ReserveMudVolume)
  24. call json%add(p,"ReserveMudVolumeGal",data%Configuration%Mud%ReserveMudVolumeGal)
  25. call json%add(p,"ReserveDensity",data%Configuration%Mud%ReserveDensity)
  26. call json%add(p,"ReservePlasticViscosity",data%Configuration%Mud%ReservePlasticViscosity)
  27. call json%add(p,"ReserveYieldPoint",data%Configuration%Mud%ReserveYieldPoint)
  28. call json%add(p,"ReserveThetaThreeHundred",data%Configuration%Mud%ReserveThetaThreeHundred)
  29. call json%add(p,"ReserveThetaSixHundred",data%Configuration%Mud%ReserveThetaSixHundred)
  30. call json%add(p,"ActiveTotalTankCapacity",data%Configuration%Mud%ActiveTotalTankCapacity)
  31. call json%add(p,"ActiveTotalTankCapacityGal",data%Configuration%Mud%ActiveTotalTankCapacityGal)
  32. call json%add(p,"ActiveSettledContents",data%Configuration%Mud%ActiveSettledContents)
  33. call json%add(p,"ActiveSettledContentsGal",data%Configuration%Mud%ActiveSettledContentsGal)
  34. ! call json%add(p,"ActiveTotalContents",data%Configuration%Mud%ActiveTotalContents)
  35. ! call json%add(p,"ActiveTotalContentsGal",data%Configuration%Mud%ActiveTotalContentsGal)
  36. call json%add(p,"ActiveAutoDensity",data%Configuration%Mud%ActiveAutoDensity)
  37. call json%add(p,"InitialTripTankMudVolume",data%Configuration%Mud%InitialTripTankMudVolume)
  38. call json%add(p,"InitialTripTankMudVolumeGal",data%Configuration%Mud%InitialTripTankMudVolumeGal)
  39. call json%add(p,"PedalFlowMeter",data%Configuration%Mud%PedalFlowMeter)
  40. ! 3. add new node to parent
  41. call json%add(parent,p)
  42. end subroutine
  43. subroutine MudPropertiesFromJson(parent)
  44. use json_module,IK =>json_ik
  45. type(json_value),pointer :: parent
  46. type(json_core) :: json
  47. type(json_value),pointer :: p,pitem
  48. call json%get(parent,'Mud',p)
  49. call json%get(p,"ActiveMudType",pitem)
  50. call json%get(pitem,data%Configuration%Mud%ActiveMudType)
  51. call json%get(p,"ActiveRheologyModel",pitem)
  52. call json%get(pitem,data%Configuration%Mud%ActiveRheologyModel)
  53. call json%get(p,"ActiveMudVolume",pitem)
  54. call json%get(pitem,data%Configuration%Mud%ActiveMudVolume)
  55. call json%get(p,"ActiveMudVolumeGal",pitem)
  56. call json%get(pitem,data%Configuration%Mud%ActiveMudVolumeGal)
  57. call json%get(p,"ActiveDensity",pitem)
  58. call json%get(pitem,data%Configuration%Mud%ActiveDensity)
  59. call json%get(p,"ActivePlasticViscosity",pitem)
  60. call json%get(pitem,data%Configuration%Mud%ActivePlasticViscosity)
  61. call json%get(p,"ActiveYieldPoint",pitem)
  62. call json%get(pitem,data%Configuration%Mud%ActiveYieldPoint)
  63. call json%get(p,"ActiveThetaThreeHundred",pitem)
  64. call json%get(pitem,data%Configuration%Mud%ActiveThetaThreeHundred)
  65. call json%get(p,"ActiveThetaSixHundred",pitem)
  66. call json%get(pitem,data%Configuration%Mud%ActiveThetaSixHundred)
  67. call json%get(p,"ReserveMudType",pitem)
  68. call json%get(pitem,data%Configuration%Mud%ReserveMudType)
  69. call json%get(p,"ReserveMudVolume",pitem)
  70. call json%get(pitem,data%Configuration%Mud%ReserveMudVolume)
  71. call json%get(p,"ReserveMudVolumeGal",pitem)
  72. call json%get(pitem,data%Configuration%Mud%ReserveMudVolumeGal)
  73. call json%get(p,"ReserveDensity",pitem)
  74. call json%get(pitem,data%Configuration%Mud%ReserveDensity)
  75. call json%get(p,"ReservePlasticViscosity",pitem)
  76. call json%get(pitem,data%Configuration%Mud%ReservePlasticViscosity)
  77. call json%get(p,"ReserveYieldPoint",pitem)
  78. call json%get(pitem,data%Configuration%Mud%ReserveYieldPoint)
  79. call json%get(p,"ReserveThetaThreeHundred",pitem)
  80. call json%get(pitem,data%Configuration%Mud%ReserveThetaThreeHundred)
  81. call json%get(p,"ReserveThetaSixHundred",pitem)
  82. call json%get(pitem,data%Configuration%Mud%ReserveThetaSixHundred)
  83. call json%get(p,"ActiveTotalTankCapacity",pitem)
  84. call json%get(pitem,data%Configuration%Mud%ActiveTotalTankCapacity)
  85. call json%get(p,"ActiveTotalTankCapacityGal",pitem)
  86. call json%get(pitem,data%Configuration%Mud%ActiveTotalTankCapacityGal)
  87. call json%get(p,"ActiveSettledContents",pitem)
  88. call json%get(pitem,data%Configuration%Mud%ActiveSettledContents)
  89. call json%get(p,"ActiveSettledContentsGal",pitem)
  90. call json%get(pitem,data%Configuration%Mud%ActiveSettledContentsGal)
  91. ! call json%get(p,"ActiveTotalContents",pitem)
  92. ! call json%get(pitem,data%Configuration%Mud%ActiveTotalContents)
  93. ! call json%get(p,"ActiveTotalContentsGal",pitem)
  94. ! call json%get(pitem,data%Configuration%Mud%ActiveTotalContentsGal)
  95. call json%get(p,"ActiveAutoDensity",pitem)
  96. call json%get(pitem,data%Configuration%Mud%ActiveAutoDensity)
  97. call json%get(p,"InitialTripTankMudVolume",pitem)
  98. call json%get(pitem,data%Configuration%Mud%InitialTripTankMudVolume)
  99. call json%get(p,"InitialTripTankMudVolumeGal",pitem)
  100. call json%get(pitem,data%Configuration%Mud%InitialTripTankMudVolumeGal)
  101. call json%get(p,"PedalFlowMeter",pitem)
  102. call json%get(pitem,data%Configuration%Mud%PedalFlowMeter)
  103. end subroutine
  104. subroutine Set_ActiveMudVolume_StudentStation(v)
  105. implicit none
  106. real*8, intent(in) :: v
  107. #ifdef ExcludeExtraChanges
  108. if(data%Configuration%Mud%ActiveMudVolume == v) return
  109. #endif
  110. data%Configuration%Mud%ActiveMudVolume = v
  111. ! if(associated(ActiveMudVolumePtr)) call ActiveMudVolumePtr(data%Configuration%Mud%ActiveMudVolume)
  112. end subroutine
  113. subroutine Set_ActiveDensity_StudentStation(v)
  114. implicit none
  115. real*8, intent(in) :: v
  116. #ifdef ExcludeExtraChanges
  117. if(data%Configuration%Mud%ActiveDensity == v) return
  118. #endif
  119. data%Configuration%Mud%ActiveDensity = v
  120. ! if(associated(ActiveDensityPtr)) call ActiveDensityPtr(data%Configuration%Mud%ActiveDensity)
  121. end subroutine
  122. subroutine Set_ReserveMudVolume_StudentStation(v)
  123. implicit none
  124. real*8, intent(in) :: v
  125. #ifdef ExcludeExtraChanges
  126. if(data%Configuration%Mud%ReserveMudVolume == v) return
  127. #endif
  128. data%Configuration%Mud%ReserveMudVolume = v
  129. ! if(associated(ReserveMudVolumePtr)) call ReserveMudVolumePtr(data%Configuration%Mud%ReserveMudVolume)
  130. end subroutine
  131. subroutine Set_ReserveDensity_StudentStation(v)
  132. implicit none
  133. real*8, intent(in) :: v
  134. #ifdef ExcludeExtraChanges
  135. if(data%Configuration%Mud%ReserveDensity == v) return
  136. #endif
  137. data%Configuration%Mud%ReserveDensity = v
  138. ! if(associated(ReserveDensityPtr)) call ReserveDensityPtr(data%Configuration%Mud%ReserveDensity)
  139. end subroutine
  140. end module MudPropertiesModule