Skip to content

Commit

Permalink
From Lia Lavezzi:
Browse files Browse the repository at this point in the history
     we realized that there is a little change to be done to the routine
trprfn.F, due to our last fix with IERR = 5 (for the cases when start and
end points of the step coincide): the problem is that the check for
coincidence (IERR = 5) is made before the check for 0 momentum (IERR = 2).
For this reason at low energies when the particle loses all its kinetic
energy and should stop with IERR = 2, it keeps trying to go on and hitting
the same point (IERR = 5) . This does not affect the results, but it is a
wrong behaviour.
With the fix, that just switches the two checks, the tests on the
particle propagation are made in the correct order.
  • Loading branch information
Rene Brun authored and Rene Brun committed Dec 23, 2010
1 parent 8d3fd89 commit f6379a0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions erpremc/trprfn.F
Original file line number Diff line number Diff line change
Expand Up @@ -125,19 +125,18 @@ SUBROUTINE TRPRFN(X1,P1,H1,X2,P2,H2,CH,XL,R,MVAR,IFLAG,ITRAN,IERR)
*
*
*
20 PA1=SQRT(P1(1)**2+P1(2)**2+P1(3)**2)
PA2=SQRT(P2(1)**2+P2(2)**2+P2(3)**2)
IF(PA1*PA2.EQ.0.) GO TO 902
* A. Rotondi and L. Lavezzi (sept 2010)
* if the first and last point coincide
* set IERR to 5 and exit
20 IF((X1(1).EQ.X2(1)).AND.(X1(2).EQ.X2(2))
IF((X1(1).EQ.X2(1)).AND.(X1(2).EQ.X2(2))
+ .AND.(X1(3).EQ.X2(3))) THEN
IERR = 5
GOTO 999
ENDIF
* ***********************************

PA1=SQRT(P1(1)**2+P1(2)**2+P1(3)**2)
PA2=SQRT(P2(1)**2+P2(2)**2+P2(3)**2)
IF(PA1*PA2.EQ.0.) GO TO 902
C DPA = PA2 - PA1
PM1=1./PA1
PM2=1./PA2
Expand Down

0 comments on commit f6379a0

Please sign in to comment.