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.

CHoisting.i90 2.2 KiB

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