gamt2
C GAMT2 SOURCE CHAT 05/01/13 00:15:38 5004 C IMPLICIT INTEGER(I-N) IMPLICIT REAL*8 (A-H,O-Z) -INC PPARAM -INC CCOPTIO DIMENSION S(*),DS(*) C RF=YUNG*YUNG*1.D-16 GAMRF=1.D-7 C X=DS(4)*DS(4)-DS(1)*DS(2) Y=(R-S(1))*DS(2)+(R-S(2))*DS(1)+2.D0*S(4)*DS(4) Z=S(4)*S(4)-S(1)*S(2)+R*(S(1)+S(2))-R*R * IF(IIMPI.EQ.9) THEN WRITE(IOIMP,*) ' S1=',S(1),' DS1=',DS(1) WRITE(IOIMP,*) ' S2=',S(2),' DS2=',DS(2) WRITE(IOIMP,*) ' S4=',S(4),' DS4=',DS(4) WRITE(IOIMP,*) ' R =',R WRITE(IOIMP,*) ' X =',X WRITE(IOIMP,*) ' Y =',Y WRITE(IOIMP,*) ' Z =',Z ENDIF * IF(ABS(X).LT.RF) X=0.D0 IF(ABS(Y).LT.RF) Y=0.D0 IF(ABS(Z).LT.RF) Z=0.D0 IF(IIMPI.EQ.9) THEN WRITE(IOIMP,*) ' XN=',X WRITE(IOIMP,*) ' YN=',Y WRITE(IOIMP,*) ' ZN=',Z ENDIF IF(X.EQ.0.D0) GO TO 1 DELTA=Y*Y-4.D0*X*Z IF(IIMPI.EQ.9) WRITE(IOIMP,*) 'DELTA=',DELTA IF(ABS(DELTA).LT.RF.AND.DELTA.LT.0.D0) DELTA=0.D0 IF(DELTA.GE.0.D0) GO TO 2 GAMA=1.D0 RETURN C 2 RADEL=SQRT(DELTA) GAMA1=(-Y+RADEL)/(2.D0*X) GAMA2=(-Y-RADEL)/(2.D0*X) IF(IIMPI.EQ.9) THEN WRITE(IOIMP,*) 'GAMA1=',GAMA1 WRITE(IOIMP,*) 'GAMA2=',GAMA2 ENDIF IF(ABS(GAMA1).LE.GAMRF) GAMA1=0.D0 IF(ABS(GAMA2).LE.GAMRF) GAMA2=0.D0 IF(GAMA1.GT.1.D0) GAMA1=1.D0 IF(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