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.
 
 
 
 
 
 

157 rivejä
7.9 KiB

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