https://github.com/florentrenaud/nbody6tt
Raw File
Tip revision: 8a4716382ead3ece116c48a4ae5c65f8c9534437 authored by Florent on 29 January 2015, 12:19:28 UTC
Nbody6 - 29 January 2015 (added GPU2/Build/.gitkeep)
Tip revision: 8a47163
offset.f
      SUBROUTINE OFFSET(DTOFF)
*
*
*       Offset of global times.
*       -----------------------
*
      INCLUDE 'common6.h'
      COMMON/CLUMP/   BODYS(NCMAX,5),T0S(5),TS(5),STEPS(5),RMAXS(5),
     &                NAMES(NCMAX,5),ISYS(5)
*
*
*       Update the global offset time.
    1 TOFF = TOFF + DTOFF
*
*       Reduce all individual times and epochs by offset interval.
      DO 10 I = 1,NTOT
          T0(I) = T0(I) - DTOFF
          T0R(I) = T0R(I) - DTOFF
          TEV(I) = TEV(I) - DTOFF
          TEV0(I) = TEV0(I) - DTOFF
          EPOCH(I) = EPOCH(I) - DTOFF*TSTAR
   10 CONTINUE
*
*       Set new global times.
      TIME = TIME - DTOFF
      TADJ = TADJ - DTOFF
      TNEXT = TNEXT - DTOFF
      TPREV = TPREV - DTOFF
      TBLIST = TBLIST - DTOFF
      IF (KZ(19).GT.2) THEN
          TPLOT = TPLOT - DTOFF
          TMDOT = TMDOT - DTOFF
      END IF
      DO 20 I = 1,NSUB
          T0S(I) = T0S(I) - DTOFF
          TS(I) = TS(I) - DTOFF
   20 CONTINUE
*
*       Check tidal tail members (note TNEW also needs doing).
      IF (NTAIL.GT.0) THEN
          DO 30 I = ITAIL0,NTTOT
              T0(I) = T0(I) - DTOFF
              TNEW(I) = TNEW(I) - DTOFF
   30     CONTINUE
      END IF
*
*       See whether more reductions are needed.
      IF (TIME.GE.DTOFF) GO TO 1
*
*       Activate control indicator for new scheduling.
      IPHASE = -1
*
      RETURN
*
      END
back to top