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.2 KiB

  1. module CHoisting
  2. use SimulationVariables
  3. use json_module
  4. implicit none
  5. public
  6. contains
  7. subroutine HoistingFromJson(parent)
  8. use json_module,IK =>json_ik
  9. type(json_value),pointer :: parent
  10. type(json_core) :: json
  11. type(json_value),pointer :: p,pitem,pval
  12. logical::is_found
  13. integer::i,n_children
  14. CHARACTER(KIND=JSON_CK, LEN=:), ALLOCATABLE :: val
  15. call json%get(parent,'Hoisting',p)
  16. call json%get(p,'DriveType',pval)
  17. call json%get(pval,data%Configuration%Hoisting%DriveType)
  18. call json%get(p,'TravelingBlockWeight',pval)
  19. call json%get(pval,data%Configuration%Hoisting%TravelingBlockWeight)
  20. call json%get(p,'TopDriveWeight',pval)
  21. call json%get(pval,data%Configuration%Hoisting%TopDriveWeight)
  22. call json%get(p,'KellyWeight',pval)
  23. call json%get(pval,data%Configuration%Hoisting%KellyWeight)
  24. call json%get(p,'NumberOfLine',pval)
  25. call json%get(pval,data%Configuration%Hoisting%NumberOfLine)
  26. call json%get(p,'DrillingLineBreakingLoad',pval)
  27. call json%get(pval,data%Configuration%Hoisting%DrillingLineBreakingLoad)
  28. end subroutine
  29. subroutine HoistingToJson(parent)
  30. type(json_value),pointer :: parent
  31. type(json_core) :: json
  32. type(json_value),pointer :: p
  33. ! 1. create new node
  34. call json%create_object(p,'Hoisting')
  35. ! 2. add member of data type to new node
  36. ! call StringConfigurationToJson(p)
  37. ! call FormationToJson(p)
  38. call json%add(p,"DrillingLineBreakingLoadAbrasiveness",data%Configuration%Hoisting%DrillingLineBreakingLoad)
  39. call json%add(p,"DriveTypeAbrasiveness",data%Configuration%Hoisting%DriveType)
  40. call json%add(p,"KellyWeightAbrasiveness",data%Configuration%Hoisting%KellyWeight)
  41. call json%add(p,"NumberOfLineAbrasiveness",data%Configuration%Hoisting%NumberOfLine)
  42. call json%add(p,"TopDriveWeightAbrasiveness",data%Configuration%Hoisting%TopDriveWeight)
  43. call json%add(p,"TravelingBlockWeightAbrasiveness",data%Configuration%Hoisting%TravelingBlockWeight)
  44. ! 3. add new node to parent
  45. call json%add(parent,p)
  46. end subroutine
  47. end module CHoisting