subroutine TD_StrainCalculation(i)
    
   Use TD_DrillStemComponents
   use SimulationVariables !@
   use SimulationVariables !@
   use SimulationVariables !@
   

   implicit none
   
   Integer :: i
    
    
    
    if (data%State%TD_String%DrillStemAxialVelocity>=0.d0) then
       
        if (i == 1) then
            data%State%TD_DrillStems(i)%Force2  = data%State%TD_DrillStems(i)%Force2 + data%State%TD_DrillStems(i)%Drag
            data%State%TD_DrillStems(i)%Dl      = (data%State%TD_DrillStems(i)%Force2) * data%State%TD_DrillStems(i)%Length / data%State%TD_DrillStems(i)%Area / data%State%TD_DrillStems(i)%ElasticModule
            data%State%TD_DrillStems(i)%DlTotal = data%State%TD_DrillStems(i)%Dl
        else
        !do i = 2 , data%State%TD_String%DrillStemComponentsNumbs
            data%State%TD_DrillStems(i)%Force2  = data%State%TD_DrillStems(i)%Force2 + data%State%TD_DrillStems(i)%Drag
            data%State%TD_DrillStems(i)%Dl      = (data%State%TD_DrillStems(i)%Force2) * data%State%TD_DrillStems(i)%Length / data%State%TD_DrillStems(i)%Area / data%State%TD_DrillStems(i)%ElasticModule
            data%State%TD_DrillStems(i)%DlTotal = data%State%TD_DrillStems(i-1)%DlTotal + data%State%TD_DrillStems(i)%Dl
        !end do
        end if
        
        
    else if (data%State%TD_String%DrillStemAxialVelocity<0.) then
        
       if (i == 1) then
        data%State%TD_DrillStems(i)%Force2  = data%State%TD_DrillStems(i)%Force2 - data%State%TD_DrillStems(i)%Drag
        data%State%TD_DrillStems(i)%Dl      = (data%State%TD_DrillStems(i)%Force2) * data%State%TD_DrillStems(i)%Length / data%State%TD_DrillStems(i)%Area / data%State%TD_DrillStems(i)%ElasticModule
        data%State%TD_DrillStems(i)%DlTotal = data%State%TD_DrillStems(i)%Dl
       else
        !do i = 2 , data%State%TD_String%DrillStemComponentsNumbs 
            data%State%TD_DrillStems(i)%Force2  = data%State%TD_DrillStems(i)%Force2 - data%State%TD_DrillStems(i)%Drag
            data%State%TD_DrillStems(i)%Dl      = (data%State%TD_DrillStems(i)%Force2) * data%State%TD_DrillStems(i)%Length / data%State%TD_DrillStems(i)%Area / data%State%TD_DrillStems(i)%ElasticModule
            data%State%TD_DrillStems(i)%DlTotal = data%State%TD_DrillStems(i-1)%DlTotal + data%State%TD_DrillStems(i)%Dl
        !end do
       end if
       
        
    end if
    

!=====> Modified Length of Drill Stem
    !data%State%TD_DrillStems(i)%Length = data%State%TD_DrillStems(i)%LengthIni + data%State%TD_DrillStems(i)%Dl
    data%State%TD_DrillStems(i)%Length  = data%State%TD_DrillStems(i)%LengthIni
     
   
     
end subroutine