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.
 
 
 
 
 
 

54 lines
2.1 KiB

  1. module CTanks
  2. use SimulationVariables
  3. use CManifolds
  4. implicit none
  5. public
  6. contains
  7. subroutine TankToJson(parent)
  8. type(json_value),pointer :: parent
  9. type(json_core) :: json
  10. type(json_value),pointer :: p,pform
  11. integer :: i
  12. call json%create_array(p,'Tank')
  13. call json%create_object(pform,'')
  14. call json%add(pform,"WaterRate",data%EquipmentControl%Tank%WaterRate)
  15. call json%add(pform,"CementTankVolume",data%EquipmentControl%Tank%CementTankVolume)
  16. call json%add(pform,"CementTankDensity",data%EquipmentControl%Tank%CementTankDensity)
  17. call json%add(pform,"TripTankVolume",data%EquipmentControl%Tank%TripTankVolume)
  18. call json%add(pform,"TripTankDensity",data%EquipmentControl%Tank%TripTankDensity)
  19. call json%add(pform,"ManualPumpPower",data%EquipmentControl%Tank%ManualPumpPower)
  20. call json%add(pform,"Valve1",data%EquipmentControl%Tank%Valve1)
  21. call json%add(pform,"Valve2",data%EquipmentControl%Tank%Valve2)
  22. call json%add(pform,"Valve3",data%EquipmentControl%Tank%Valve3)
  23. call json%add(pform,"Valve4",data%EquipmentControl%Tank%Valve4)
  24. call json%add(pform,"Valve5",data%EquipmentControl%Tank%Valve5)
  25. call json%add(pform,"Valve6",data%EquipmentControl%Tank%Valve6)
  26. call json%add(pform,"Valve7",data%EquipmentControl%Tank%Valve7)
  27. call json%add(pform,"Valve8",data%EquipmentControl%Tank%Valve8)
  28. call json%add(pform,"Valve9",data%EquipmentControl%Tank%Valve9)
  29. call json%add(pform,"Valve10",data%EquipmentControl%Tank%Valve10)
  30. call json%add(pform,"Valve11",data%EquipmentControl%Tank%Valve11)
  31. call json%add(parent,p)
  32. end subroutine
  33. subroutine Set_ManualPumpPower(v)
  34. use CManifolds, only:ChangeValve
  35. implicit none
  36. logical, intent(in) :: v
  37. data%EquipmentControl%Tank%ManualPumpPower = v
  38. call ChangeValve(43, v)
  39. #ifdef deb
  40. print*, 'ManualPumpPower=', data%EquipmentControl%Tank%ManualPumpPower
  41. #endif
  42. end subroutine
  43. end module CTanks