Skip to content

Commit

Permalink
Fix the period output in start.F for initialization of ks binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
lwang-astro committed Mar 25, 2019
1 parent 4b3555b commit 381d043
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/Main/start.F
Original file line number Diff line number Diff line change
Expand Up @@ -163,26 +163,30 @@ SUBROUTINE START
ICOMP = 2*IPAIR - 1
JCOMP = 2*IPAIR
RIJ2 = 0.0
VIJ2 = 0.d0
* Include standard distance criterion.
DO 45 K = 1,3
RIJ2 = RIJ2 + (X(K,ICOMP) - X(K,JCOMP))**2
VIJ2 = VIJ2 + (XDOT(K,I1) - XDOT(K,I2))**2
45 CONTINUE
IF(RIJ2.LT.SMMIN) SMMIN=RIJ2
IF(RIJ2.GT.SMMAX) SMMAX=RIJ2
RIJ = SQRT(RIJ2)
IF(RIJ.LT.SMMIN) SMMIN=RIJ
IF(RIJ.GT.SMMAX) SMMAX=RIJ
XMBIN = BODY(ICOMP) + BODY(JCOMP)
PERIOD = RIJ2**0.75/DSQRT(XMBIN)
SEMI = 1.d0/(2.d0/RIJ - VIJ2/XMBIN)
PERIOD = TWOPI*SEMI*SQRT(DABS(SEMI)/XMBIN)
IF(XMBIN.LT.XMMIN) XMMIN=XMBIN
IF(XMBIN.GT.XMMAX) XMMAX=XMBIN
IF(PERIOD.LT.TMMIN) TMMIN=PERIOD
IF(PERIOD.GT.TMMAX) TMMAX=PERIOD
IF (RIJ2.LT.RMIN**2) THEN
IF (RIJ.LT.RMIN) THEN
CALL KSPREG
END IF
50 CONTINUE
* recover kstart
KSTART = KSDUM
* Diagnostic
if(rank.eq.0) write(6,51) SQRT(SMMIN)*RAU, SQRT(SMMAX)*RAU,
if(rank.eq.0) write(6,51) SMMIN*RAU, SMMAX*RAU,
& XMMIN*ZMBAR, XMMAX*ZMBAR, TMMIN*DAYS, TMMAX*DAYS
51 format(/,' Binary parameters: R12(min)[AU]',F15.6,
& ' R12(max)[AU]',F15.6,' MCM(min)[M*]',F15.6,
Expand Down

0 comments on commit 381d043

Please sign in to comment.