59
59
60
60
SUBROUTINE trgTrack (u ,E ,dl ,l ,spect )
61
61
IMPLICIT NONE
62
- REAL * 8 u(6 ),E,dl,l
62
+ REAL * 8 u(9 ),E,dl,l
63
63
INTEGER spect
64
64
* -- track a single particle with given start parameters
65
65
*
@@ -91,7 +91,7 @@ SUBROUTINE trgTrack (u,E,dl,l,spect)
91
91
92
92
SUBROUTINE trgXTrack (u ,E ,dl ,l ,Bdl ,Xfun ,id ,spect )
93
93
IMPLICIT NONE
94
- REAL * 8 u(6 ),E,dl,l,Bdl
94
+ REAL * 8 u(9 ),E,dl,l,Bdl
95
95
INTEGER id,spect
96
96
INTEGER Xfun
97
97
EXTERNAL Xfun
@@ -142,6 +142,9 @@ SUBROUTINE trgXTrack (u,E,dl,l,Bdl,Xfun,id,spect)
142
142
DO i= 1 ,6
143
143
u(i) = uu (i)
144
144
ENDDO
145
+ DO i= 7 ,9
146
+ u (i) = 0 .
147
+ ENDDO
145
148
146
149
! calculate Bdl ( B_x^2 + B_y^2 + B_z^2 )
147
150
Bdl = SQRT (uu(7 )** 2 + uu(8 )** 2 + uu(9 )** 2 )
@@ -151,7 +154,7 @@ SUBROUTINE trgXTrack (u,E,dl,l,Bdl,Xfun,id,spect)
151
154
152
155
SUBROUTINE trgTrackToPlane (u ,E ,dl ,a ,b ,c ,d ,ok ,spect )
153
156
IMPLICIT NONE
154
- REAL * 8 u(6 ),E,dl,a,b,c,d
157
+ REAL * 8 u(9 ),E,dl,a,b,c,d
155
158
INTEGER spect
156
159
LOGICAL ok
157
160
* -- track a single particle with given start parameters
@@ -174,7 +177,7 @@ SUBROUTINE trgTrackToPlane (u,E,dl,a,b,c,d,ok,spect)
174
177
REAL * 8 factor
175
178
COMMON / trgConversionFactor/ factor
176
179
177
- REAL * 8 ts,n,an,bn,cn,dn,maxdist,dist0,dist1,u0(6 ),u1(6 )
180
+ REAL * 8 ts,n,an,bn,cn,dn,maxdist,dist0,dist1,u0(9 ),u1(9 )
178
181
179
182
INTEGER i,steps,max_steps
180
183
@@ -486,7 +489,7 @@ SUBROUTINE trgDeriv(u,dudt,spect)
486
489
487
490
SUBROUTINE trgRK4(u0,u1,h,spect)
488
491
IMPLICIT NONE
489
- REAL*8 u0(6 ),u1(6 ),h
492
+ REAL*8 u0(9 ),u1(9 ),h
490
493
* -- Fourth-order Runge-Kutta from Numerical Recipes book
491
494
* for tracking through the target field
492
495
*
@@ -499,7 +502,7 @@ SUBROUTINE trgRK4(u0,u1,h,spect)
499
502
* spect I: -1 for e spectrometer, +1 for p spectrometer
500
503
501
504
INTEGER i,spect
502
- REAL*8 ut(6 ),dudt(9),dut(9),dum(9),hh,h6
505
+ REAL*8 ut(9 ),dudt(9),dut(9),dum(9),hh,h6
503
506
504
507
hh=h*0.5
505
508
h6=h/6.
@@ -616,7 +619,7 @@ subroutine track_from_tgt(x,y,z,dx,dy,mom,mass,spect,ok)
616
619
parameter (cc = 29.9792458 )
617
620
real * 8 vel ! velocity of particle [cm/ ns]
618
621
real * 8 eng ! energy of particle
619
- real * 8 vT(6 )
622
+ real * 8 vT(9 )
620
623
621
624
C write(*,*) 'from target',spect
622
625
C write(*,*) mom,mass
@@ -748,7 +751,7 @@ subroutine track_to_tgt(delta,y,dx,dy,frx,fry,mom,mass,ctheta,
748
751
integer spect,arm
749
752
logical ok
750
753
751
- real * 8 vT(6 ),vTx(6 )
754
+ real * 8 vT(9 ),vTx(9 )
752
755
real * 8 xx,delx
753
756
real * 8 xxd
754
757
integer * 2 i,n
@@ -877,7 +880,7 @@ subroutine print_coord1(txt,y,delta,dxdz,dydz,x,z)
877
880
include ' simulate.inc'
878
881
character * (* ) txt
879
882
real * 8 y,delta,dxdz,dydz,x,z
880
- real * 8 vT(6 )
883
+ real * 8 vT(9 )
881
884
882
885
vt(1 ) = - x
883
886
vt(2 ) = y
@@ -900,7 +903,7 @@ subroutine print_coord2(txt,x,y,z,dxdz,dydz)
900
903
include ' simulate.inc'
901
904
character * (* ) txt
902
905
real * 8 y,dxdz,dydz,x,z
903
- real * 8 vT(6 )
906
+ real * 8 vT(9 )
904
907
905
908
vt(1 ) = x
906
909
vt(2 ) = y
0 commit comments