PROGRAM RYG TEST C This program tests the coefficients calculated by the programs trntrx or C trnstx. C DOUBLE PRECISION RYGCOF(0:45450) DOUBLE PRECISION DLAMDA(5) DOUBLE PRECISION G2, G3, G2SUM, G3SUM, TEST1, TEST2, TEST3 DOUBLE PRECISION ZL, COEF, XL, XLP1 INTEGER J, ISTEP, IQ, MMIN, MMAX, M, NM CHARACTER*4 ID LOGICAL LOADED DATA LOADED/.FALSE./ DATA DLAMDA/1.0D0,0.25D0,0.1D0,2.0D0,4.0D0/ WRITE(6,200) 200 FORMAT(1X,'TESTING ASYMPTOTIC EXPRESSIONS FOR COEFFICIENTS OF YG') IF( .NOT.LOADED) THEN OPEN(3,FILE='ryg300.dat',STATUS='OLD') READ(3,10) ID,MAXS 10 FORMAT(A4,I5) IF( ID.NE.' RYG') THEN WRITE(*,20) 20 FORMAT( 1X,'WRONG COEFFICIENTS FOR RYG') STOP ENDIF READ(3,30)RYGCOF 30 FORMAT(D22.16) CLOSE(3) LOADED=.TRUE. ENDIF DO 50 J=1,5 WRITE(6,1000)DLAMDA(J) 1000 FORMAT(/1X,'LAMBDA =',F8.3) WRITE(6,100) 100 FORMAT(/2X,'M',5X,'COEF',8X,'T1=M*COEF',4X,'2*G2 ',3X, & 'T2=(T1-2*G2 )(M+2)',2X,'T3=T2+4*G3 ') C C The Gx are the functions g from Jeffrey, (1991). IF(DLAMDA(J) .LE. 1) THEN XL=DLAMDA(J) XLP1=XL+1D0 G2=(4*XL-XL**2+7D0*XL**3)/(10D0*XLP1**3) G3=(32D0-179*XL+532D0*XL**2-356*XL**3+221D0*XL**4) & /(500D0*XLP1**3) ISTEP=1 ELSE XL=1.0D0/DLAMDA(J) XLP1=XL+1D0 G2=(7D0-XL+4D0*XL**2D0)/(10D0*XLP1**3D0) G3=(221D0-356D0*XL+532D0*XL**2D0-179D0*XL**3D0+32D0*XL**4D0) & /(500D0*XL*XLP1**3D0) ISTEP=-1 ENDIF MMIN=150 MMAX=MAXS G2SUM=2D0*G2 G3SUM=4D0*G3 DO 900 M=MMIN,MMAX IF (ISTEP .GT. 0) THEN NM = (M*(M+1))/2 ELSE NM = (M*(M+1))/2 +M ENDIF ZL=XLP1**(-M) COEF=0D0 DO 950 IQ=0,M COEF=COEF+RYGCOF(NM)*ZL NM=NM+ISTEP ZL=ZL*XL 950 CONTINUE TEST1=DBLE(M)*COEF TEST2=DBLE(M+2)*(TEST1-G2SUM) TEST3=TEST2+G3SUM WRITE(6,60) M,COEF,TEST1,G2SUM,TEST2,TEST3 60 FORMAT(1X,I3,3D13.5,2D13.5) 900 CONTINUE 50 CONTINUE STOP END