module CCasingLinerChoke
    use SimulationVariables
    use json_module
    implicit none    
    public    
    contains   
    
    subroutine CasingLinerChokeToJson(parent)

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

        ! 1. create new node
        call json%create_object(p,'CasingLinerChoke')
        
        ! 2. add member of data type to new node
        ! call StringConfigurationToJson(p) 
        ! call FormationToJson(p) 
        call json%add(p,"CasingDepth",data%Configuration%CasingLinerChoke%CasingDepth)
        call json%add(p,"CasingId",data%Configuration%CasingLinerChoke%CasingId)
        call json%add(p,"CasingOd",data%Configuration%CasingLinerChoke%CasingOd)
        call json%add(p,"CasingWeight",data%Configuration%CasingLinerChoke%CasingWeight)
        call json%add(p,"CasingCollapsePressure",data%Configuration%CasingLinerChoke%CasingCollapsePressure)
        call json%add(p,"CasingTensileStrength",data%Configuration%CasingLinerChoke%CasingTensileStrength)
        call json%add(p,"LinerTopDepth",data%Configuration%CasingLinerChoke%LinerTopDepth)
        call json%add(p,"LinerLength",data%Configuration%CasingLinerChoke%LinerLength)
        call json%add(p,"LinerId",data%Configuration%CasingLinerChoke%LinerId)
        call json%add(p,"LinerOd",data%Configuration%CasingLinerChoke%LinerOd)
        call json%add(p,"LinerWeight",data%Configuration%CasingLinerChoke%LinerWeight)
        call json%add(p,"LinerCollapsePressure",data%Configuration%CasingLinerChoke%LinerCollapsePressure)
        call json%add(p,"LinerTensileStrength",data%Configuration%CasingLinerChoke%LinerTensileStrength)
        call json%add(p,"OpenHoleId",data%Configuration%CasingLinerChoke%OpenHoleId)
        call json%add(p,"OpenHoleLength",data%Configuration%CasingLinerChoke%OpenHoleLength)
        ! 3. add new node to parent
        call json%add(parent,p)
    end subroutine


end module CCasingLinerChoke