SUBROUTINE ANGLE7(BE,NA,IN) INTEGER NA REAL BE(*) LOGICAL IN C C**** BE=JACIN,NA=NARCS,IN=INTER C C**** TO COMPUTE THE ARRAY OF JACOBI INDECES CORRESPONDING TO THE C**** CORNER ANGLES ON THE BOUNDARY C C**** LOCAL VARIABLES INTEGER K,B0,B1,B2 REAL X,Y,ANG,PI,R1MACH,EPS,XI,APP COMPLEX U,V,DPARFN EXTERNAL DPARFN,R1MACH C PI=4E+0*ATAN(1E+0) EPS=SQRT(R1MACH(4)) DO 1 K=1,NA U=DPARFN(K,(1.0,0.0)) U=-U/ABS(U) IF (K.EQ.NA) THEN V=DPARFN(1,(-1.0,0.0)) ELSE V=DPARFN(K+1,(-1.0,0.0)) ENDIF V=V/ABS(V) V=U/V X=REAL(V) Y=AIMAG(V) ANG=ATAN2(Y,X) IF (ANG.LT.0) THEN ANG=ANG+2E+0*PI ENDIF ANG=ANG/PI IF (.NOT.IN) THEN ANG=2E+0-ANG ENDIF ANG=-1E+0+1E+0/ANG C C**** TRY TO DETECT SIMPLE RATIONAL INDECES AND FORCE BEST REAL C**** APPROXIMATIONS C IF (ABS(ANG) .LT. EPS) THEN ANG=0E+0 ELSE XI=ABS(ANG) B0=INT(XI) XI=XI-REAL(B0) IF (ABS(XI) .LT. EPS) THEN APP=REAL(B0) ELSE XI=1E+0/XI B1=INT(XI) XI=XI-REAL(B1) IF (ABS(XI) .LT. EPS) THEN APP=REAL(1+B0*B1)/REAL(B1) ELSE XI=1E+0/XI B2=INT(XI) APP=REAL(B0*(1+B1*B2)+B2)/REAL(1+B1*B2) ENDIF ENDIF APP=SIGN(1E+0,ANG)*APP IF (ABS(ANG-APP) .LT. EPS) ANG=APP ENDIF C IF (K.EQ.NA) THEN BE(1)=ANG ELSE BE(K+1)=ANG ENDIF 1 CONTINUE END REAL FUNCTION ARGIN1(RT1,RT2,PT,DIFF1,DIFF2,ZZ,LIMIT) INTEGER PT REAL RT1,RT2,LIMIT COMPLEX DIFF1,DIFF2,ZZ C C ZZ IS A GIVEN FIELD POINT AND DIFF1, DIFF2 ARE THE DIFFERENCES C BETWEEN ZZ AND CONSECUTIVE POINTS ON THE BOUNDARY C (DIFF1=PARFUN(PT,RT1)-ZZ, ZET2=PARFUN(PT,RT2)-ZZ). THE C PURPOSE OF THIS ROUTINE IS TO CALCULATE THE INCREASE IN THE C ARGUMENT ARG(ZZ-Z) AS Z MOVES ALONG THE BOUNDARY FROM THE POINT C WITH PARAMETER VALUE RT1 TO THE POINT WITH PARAMETER VALUE RT2. C C LOCAL VARIABLES C INTEGER NANGS,NINTS REAL ANGLE,T1,T2 COMPLEX D1,D2,PARFUN,V EXTERNAL PARFUN C C LIMIT IS CURRENTLY SET TO 3*PI/4, APPROXIMATELY C T1=RT1 T2=(RT1+RT2)*5E-1 D1=DIFF1 D2=PARFUN(PT,CMPLX(T2))-ZZ NANGS=0 NINTS=2 ARGIN1=0E+0 C 10 CONTINUE V=D2*CONJG(D1) ANGLE=ATAN2(AIMAG(V),REAL(V)) IF (ABS(ANGLE) .GE. LIMIT) THEN T2=(T1+T2)*5E-1 D2=PARFUN(PT,CMPLX(T2))-ZZ NINTS=NINTS+1 GOTO 10 ELSE ARGIN1=ARGIN1+ANGLE NANGS=NANGS+1 IF (NANGS .NE. NINTS) THEN T1=T2 T2=RT2 D1=D2 D2=DIFF2 GOTO 10 ENDIF ENDIF C END SUBROUTINE ASONJ7(ALFA,BETA,A,B,H,N) INTEGER N REAL A(*),B(*),H,ALFA,BETA C ..TO ASSIGN THE COEFFICIENTS A(K) AND B(K) , K=1(1)N, IN THE C ..3-TERM RECURRENCE FORMULA FOR THE ORTHONORMAL JACOBI POLYNOMIALS C ..WHERE C .. C .. A(K)P (X) = (X - B(K))P (X) - A(K-1)P (X) , K=1,2,..,N, C .. K K-1 K-2 C .. C .. P (X) = 0 , P (X) = 1/SQRT(H) C .. -1 0 C .. C ..AND H IS THE ZEROTH MOMENT OF THE JACOBI WEIGHT FUNCTION C ..(1-X)**ALFA*(1+X)**BETA ON [-1,1]. C**** AUTHOR: DAVID HOUGH C**** LAST UPDATE: 15.09.89 C**** ..LOCAL VARIABLES.. REAL SUM,DIFF,PROD,TC,T,SC,S,GAMMA,C INTEGER K EXTERNAL GAMMA SUM=ALFA+BETA DIFF=BETA-ALFA PROD=SUM*DIFF C ..CALCULATE H. TC=SUM+1.0 SC=2.0**TC S=GAMMA(ALFA+1.0) T=GAMMA(BETA+1.0) C=GAMMA(TC+1.0) H=SC*S*T/C C ..START ON A,B ARRAYS. IF (N.GT.0) THEN T=2.0+SUM S=T*T C=4.0*(ALFA+1.0)*(BETA+1.0)/S/(T+1.0) A(1)=SQRT(C) B(1)=DIFF/T DO 10 K=2,N B(K)=PROD/T/(T+2.0) T=2.0*K+SUM S=T*T C=4.0*K*(ALFA+K)*(BETA+K)*(SUM+K)/S/(S-1.0) A(K)=SQRT(C) 10 CONTINUE ENDIF END SUBROUTINE ASQUC7(AQCOF,BQCOF,CQCOF,JACIN,NJIND,NQPTS) INTEGER NJIND,NQPTS REAL AQCOF(*),BQCOF(*),CQCOF(*),JACIN(*) C C ..TO ASSIGN THE COEFFICIENTS A(J), B(J) AND C(J) ,J=1,MN IN THE C ..3-TERM RECURRENCE FORMULA C .. C .. Q (Z) = (A(J)Z - B(J))Q (Z) - C(J)Q (Z) , J=2,...,MN C .. J+1 J J-1 C .. C .. Q (Z) = (A(1)Z - B(1))Q (Z) - C(1) C .. 2 1 C .. C ..WHERE Q (Z):=