subroutine TD_DrillStemStartUp
    
    Use CCasingLinerChokeVariables
    Use CStringConfigurationVariables
    ! Use CSimulationVariables
    Use TD_DrillStemComponents
    use SimulationVariables !@
    use SimulationVariables !@
    use SimulationVariables !@
    Use TD_StringConnectionData
   

   implicit none
   
   
  
   
   data%State%TD_String%DrillStemTotalLength    = 500.d0     !???????????????????
   data%State%TD_String%DrillStemTotalLengthIni = 500.d0     !???????????????????
   data%State%TD_String%OutOfWellLength         = 3.48d0
   data%State%TD_String%DrillStemAxialVelocity  = 0.d0
   data%State%TD_String%DrillStemRotVelocity    = 0.d0
   data%State%TD_String%WeightOnBit             = 0.d0
   data%State%TD_String%BitTorque               = 0.d0
   data%State%TD_String%TotalTorque             = 0.d0
   data%State%TD_String%StaticHookLoad          = 0.d0
   data%State%TD_String%DlMax                   = 0.d0
   data%State%TD_String%DlTotal                 = 0.d0
   data%State%TD_String%DlTouch                 = 1.d0           !(=/0.) because of TD_StringConnectionModes subroutine  (initial value for first iteration in if condition)
   data%State%TD_String%HookLoad                = 0.d0
   data%State%TD_String%StringTorque            = 0.d0
   data%State%TD_String%ToolJointRange          = 0.4005d0*3.28d0  ![m]*3.28=[ft]  ,  ToolJointLength=400.5mm
   data%State%TD_Vol%RemoveVolume               = 0.0d0
   
   data%State%TD_String%DrillStemBottom    = data%State%TD_String%DrillStemTotalLength-data%State%TD_String%OutOfWellLength   !????????????
   !data%State%TD_DrillStems%TopDepth      = 
   !data%State%TD_DrillStems%DownDepth     = 
   !data%State%TD_DrillStems%StartAngle    = 
   !data%State%TD_DrillStems%EndAngle      = 
   data%State%TD_DrillStems%Area           = 0.d0
   data%State%TD_DrillStems%RCurvature     = 0.d0
   data%State%TD_DrillStems%RtoolJoint     = 0.d0
   data%State%TD_DrillStems%ToolJointRange = 0.d0
   data%State%TD_DrillStems%HoleDiameter   = 0.d0
   
   data%State%TD_DrillStems%Force1       = 0.d0
   data%State%TD_DrillStems%Force2       = 0.d0
   data%State%TD_DrillStems%Torque       = 0.d0
   data%State%TD_DrillStems%Drag         = 0.d0
   data%State%TD_DrillStems%CombVelRatio = 0.d0
   
   data%State%TD_DrillStems%MudDensityIn      = 10.d0*7.48051948d0
   data%State%TD_DrillStems%MudDensityOut     = 10.d0*7.48051948d0
   data%State%TD_DrillStems%MudViscosity      = 0.16d0   !????????????????
   data%State%TD_DrillStems%MudVisCorrectCoef = 1.d0     !????????????????
   data%State%TD_DrillStems%MudWeight         = 10.d0
   !data%State%TD_DrillStems%MudPlasticVis    =   !????????????????
   !data%State%TD_DrillStems%MudYieldPoint    =   !????????????????
   
   !data%State%TD_DrillStems%FricFactor = 
   !data%State%TD_DrillStems%           =
   !data%State%TD_DrillStems%           =
   
   !data%State%TD_DrillStems%StaticHookLoad = 
   !data%State%TD_DrillStems%TotalSHookLoad = 
   !data%State%TD_DrillStems%Dl             = 
   !data%State%TD_DrillStems%DlTotal        = 
   
   !if (allocated(data%State%TD_String%FluidMudDensity))  deallocate(data%State%TD_String%FluidMudDensity)
   !if (allocated(data%State%TD_String%FluidMudEndX))     deallocate(data%State%TD_String%FluidMudEndX)
   !if (allocated(data%State%TD_String%FluidMudStartX))   deallocate(data%State%TD_String%FluidMudStartX)
   !Allocate (data%State%TD_String%FluidMudDensity(1) , data%State%TD_String%FluidMudEndX(1) , data%State%TD_String%FluidMudStartX(1))
   !data%State%TD_String%FluidMudDensity(:) = 10.d0
   !data%State%TD_String%FluidMudStartX(:)  = -268.d0     !??????????
   !data%State%TD_String%FluidMudEndX(:)    = 9990.d0     !??????????
   
   
   
   
  
end subroutine