Nbody6
 All Files Functions Variables
modify.f
Go to the documentation of this file.
1  SUBROUTINE modify(KSTART)
2 *
3 *
4 * Parameter modification at restart.
5 * ----------------------------------
6 *
7  include 'common6.h'
8  EXTERNAL verify
9 *
10 *
11 * Read first, second or both lines (KSTART = 3, 4, 5).
12  IF (kstart.EQ.4) go to 10
13 *
14 * Read new DTADJ, DELTAT, TADJ, TNEXT, TCRIT, QE & KZ(J) (if > 0).
15  READ (5,*) dta, dt, ta, tn, tc, qe1, j, k
16 *
17 * Copy old parameters if corresponding input is zero.
18  IF (dta.LE.0.0) THEN
19  dta = dtadj
20  END IF
21 *
22  IF (dt.LE.0.0) THEN
23  dt = deltat
24  END IF
25 *
26  IF (ta.LE.0.0) THEN
27  tadj = max(tadj - dtadj + dta,time)
28  ELSE
29  tadj = max(ta-toff,time)
30  END IF
31 *
32  IF (tn.LE.0.0) THEN
33  tnext = max(tnext - deltat + dt,time)
34  ELSE
35  tnext = max(tn-toff,time)
36  END IF
37 *
38  dtadj = dta
39  deltat = dt
40  IF (tc.GT.0.0) tcrit = tc
41  IF (qe1.GT.0.0) qe = qe1
42 *
43 * See whether any options should be changed.
44  IF (j.GT.0) kz(j) = k
45 *
46  WRITE (6,5) dtadj, deltat, tcrit, qe, j, k
47  5 FORMAT (///,7x,'RESTART PARAMETERS: DTADJ =',f7.3,' DELTAT =',
48  & f7.3,' TCRIT =',f7.1,' QE =',1pe9.1,
49  & ' KZ(',i2,') =',i2,/)
50 *
51 * Read new ETAI, ETAR, ETAU, DTMIN, RMIN, NCRIT (if > 0 & KSTART >= 4).
52  10 IF (kstart.GE.4) THEN
53  READ (5,*) eta1, eta2, eta3, dtm, rm, newcr
54 *
55 * Check modification of integration parameters.
56  IF (eta1.GT.0.0) etai = eta1
57  IF (eta2.GT.0.0) etar = eta2
58  IF (eta3.GT.0.0) etau = eta3
59  IF (dtm.GT.0.0) THEN
60  dtmin = dtm
61  smin = 2.0*dtm
62  END IF
63  IF (rm.GT.0.0) THEN
64  rmin = rm
65  rmin2 = rm**2
66  rmin22 = 4.0*rmin2
67  END IF
68  IF (newcr.GT.0) ncrit = newcr
69 *
70  WRITE (6,15) etai, etar, etau, dtmin, rmin, ncrit
71  15 FORMAT (/,7x,'RESTART PARAMETERS: ETAI =',f6.3,' ETAR =',
72  & f6.3,' ETAU =',f6.3,' DTMIN =',1p,e8.1,
73  & ' RMIN =',e8.1,' NCRIT =',0p,i5,/)
74  END IF
75 *
76 * Perform a simple validation check on main input parameters.
77  CALL verify
78 *
79 * Save the new parameters on tape/disc unit #1 just in case.
80  CALL mydump(1,1)
81 *
82  RETURN
83 *
84  END