anchor.diff:      integer(kind=kint) :: ndof, nn
   
       integer(kind=kint) :: j, tot_step, step_count
  -    integer(kind=kint) :: sub_step
  -    integer(kind=kint) :: itemp, ttemp, tintl
  -    real(kind=kreal) :: tt, factor
  -    real(kind=kreal) :: time_1, time_2
  -    logical          :: ctchanged
  +    integer(kind=kint) :: sub_step, ss_end
  +    real(kind=kreal)   :: factor
  +    real(kind=kreal)   :: time_1, time_2
  +    logical            :: ctchanged
       integer(kind=kint) :: restart_step_num, restart_substep_num
   
       hecMAT%NDOF = hecMESH%n_dof
  
positive.code:       enddo    !--- end of substep  loop
  
        restart_substep_num = 1
  
      enddo      !--- end of tot_step loop
      !
      !  message
  
negative.code:         end if
  
          if(hecMESH%my_rank==0) write(*,*) ' substep=',sub_step,fstrSOLID%FACTOR
          if( fstrSOLID%TEMP_irres > 0 ) then
            if( hecMESH%my_rank == 0 ) then
              write(*,*) " - Read in temperature in time step", fstrSOLID%TEMP_tstep
              write(ISTA,*) " - Read in temperature in time step", fstrSOLID%TEMP_tstep
            endif
          endif
          
          step_count = step_count+1
          call cpu_time(time_1)
  
          call fstr_UpdateState( hecMESH, fstrSOLID, 0.d0 )
  
          !       analysis algorithm ( Newton-Rapshon Method )
          if( .not. associated( fstrSOLID%contacts ) ) then
            call fstr_Newton( tot_step, hecMESH, hecMAT, fstrSOLID, fstrPARAM,   &
              restart_step_num, sub_step  )
          else
            if( fstrPARAM%contact_algo == kcaSLagrange ) then
              !     ----  For Parallel Contact with Multi-Partition Domains
              if(paraContactFlag.and.present(conMAT)) then
                call fstr_Newton_contactSLag( tot_step, hecMESH, hecMAT, fstrSOLID, fstrPARAM, fstrMAT,  &
                  restart_step_num, restart_substep_num, sub_step, infoCTChange, conMAT )
              else
                call fstr_Newton_contactSLag( tot_step, hecMESH, hecMAT, fstrSOLID, fstrPARAM, fstrMAT,  &
                  restart_step_num, restart_substep_num, sub_step, infoCTChange )
              endif
            else if( fstrPARAM%contact_algo == kcaALagrange ) then
              call fstr_Newton_contactALag( tot_step, hecMESH, hecMAT, fstrSOLID, fstrPARAM,            &
                restart_step_num, restart_substep_num, sub_step, infoCTChange )
            endif
          endif
  
          ! ----- Restart
          if( fstrSOLID%restart_nout < 0 ) then
            fstrSOLID%restart_nout = - fstrSOLID%restart_nout
          end if
          if( mod(step_count,fstrSOLID%restart_nout) == 0 ) then
            if( .not. associated( fstrSOLID%contacts ) ) then
              call fstr_write_restart(tot_step,sub_step,step_count,hecMESH,fstrSOLID,fstrPARAM)
            else
              call fstr_write_restart(tot_step,sub_step,step_count,hecMESH,fstrSOLID,fstrPARAM, &
                infoCTChange%contactNode_current)
            endif
          end if
          ! ----- Result output (include visualize output)
          call fstr_static_Output( tot_step, step_count, hecMESH, fstrSOLID, fstrPR%solution_type )
  
          if( fstrSOLID%TEMP_irres > 1 ) fstrSOLID%TEMP_tstep = fstrSOLID%TEMP_tstep + fstrSOLID%TEMP_interval
  
          call cpu_time(time_2)
          if( hecMESH%my_rank==0) then
  