module CRigSize
    use SimulationVariables
    use json_module
    implicit none    
    public 
    contains

    subroutine RigSizeToJson(parent)

        type(json_value),pointer :: parent
        type(json_core) :: json
        type(json_value),pointer :: p

        ! 1. create new node
        call json%create_object(p,'RigSize')
        
        ! 2. add member of data type to new node
        ! call StringConfigurationToJson(p) 
        ! call FormationToJson(p)
        call json%add(p,"RigType",data%Configuration%RigSize%RigType)
        call json%add(p,"CrownHeight",data%Configuration%RigSize%CrownHeight)
        call json%add(p,"MonkeyBoandHeight",data%Configuration%RigSize%MonkeyBoandHeight)
        call json%add(p,"RigFloorHeight",data%Configuration%RigSize%RigFloorHeight)
        ! 3. add new node to parent
        call json%add(parent,p)
    end subroutine

end module CRigSize