103 CALL zwgj (z,w,np,alpha,beta)
120 CALL zwglj (z,w,np,alpha,beta)
124 SUBROUTINE zwgj (Z,W,NP,ALPHA,BETA)
134 parameter(lzd = nmax)
135 real*8 zd(lzd),wd(lzd),aphad,betad
136 REAL Z(1),W(1),ALPHA,BETA
139 IF (np.GT.npmax)
THEN
140 WRITE (6,*)
'Too large polynomial degree in ZWGJ'
141 WRITE (6,*)
'Maximum polynomial degree is',nmax
142 WRITE (6,*)
'Here NP=',np
147 CALL zwgjd (zd,wd,np,alphad,betad)
155 SUBROUTINE zwgjd (Z,W,NP,ALPHA,BETA)
164 IMPLICIT REAL*8 (a-h,o-z)
165 real*8 z(1),w(1),alpha,beta
174 WRITE (6,*)
'ZWGJD: Minimum number of Gauss points is 1',np
177 IF ((alpha.LE.-one).OR.(beta.LE.-one))
THEN
178 WRITE (6,*)
'ZWGJD: Alpha and Beta must be greater than -1'
183 z(1) = (beta-alpha)/(apb+two)
189 CALL jacg (z,np,alpha,beta)
195 fac1 = dnp1+alpha+beta+one
198 fnorm =
pnormj(np1,alpha,beta)
199 rcoef = (fnorm*fac2*fac3)/(two*fac1*dnp2)
201 CALL jacobf (p,pd,pm1,pdm1,pm2,pdm2,np2,alpha,beta,z(i))
202 w(i) = -rcoef/(p*pdm1)
207 SUBROUTINE zwglj (Z,W,NP,ALPHA,BETA)
217 parameter(lzd = nmax)
218 real*8 zd(lzd),wd(lzd),alphad,betad
219 REAL Z(1),W(1),ALPHA,BETA
222 IF (np.GT.npmax)
THEN
223 WRITE (6,*)
'Too large polynomial degree in ZWGLJ'
224 WRITE (6,*)
'Maximum polynomial degree is',nmax
225 WRITE (6,*)
'Here NP=',np
230 CALL zwgljd (zd,wd,np,alphad,betad)
247 IMPLICIT REAL*8 (a-h,o-z)
248 real*8 z(np),w(np),alpha,beta
256 WRITE (6,*)
'ZWGLJD: Minimum number of Gauss-Lobatto points is 2'
257 WRITE (6,*)
'ZWGLJD: alpha,beta:',alpha,beta,np
260 IF ((alpha.LE.-one).OR.(beta.LE.-one))
THEN
261 WRITE (6,*)
'ZWGLJD: Alpha and Beta must be greater than -1'
268 CALL zwgjd (z(2),w(2),nm1,alpg,betg)
273 w(i) = w(i)/(one-z(i)**2)
275 CALL jacobf (p,pd,pm1,pdm1,pm2,pdm2,n,alpha,beta,z(1))
276 w(1) =
endw1(n,alpha,beta)/(two*pd)
277 CALL jacobf (p,pd,pm1,pdm1,pm2,pdm2,n,alpha,beta,z(np))
278 w(np) =
endw2(n,alpha,beta)/(two*pd)
283 REAL*8 FUNCTION endw1 (N,ALPHA,BETA)
284 IMPLICIT REAL*8 (a-h,o-z)
297 f1 = f1*(apb+two)*two**(apb+two)/two
303 fint1 = fint1*two**(apb+two)
305 fint2 = fint2*two**(apb+three)
306 f2 = (-two*(beta+two)*fint1 + (apb+four)*fint2)
316 a1 = -(two*(di+alpha)*(di+beta))/(abn*abnn*(abnn+one))
317 a2 = (two*(alpha-beta))/(abnn*(abnn+two))
318 a3 = (two*(abn+one))/((abnn+two)*(abnn+one))
319 f3 = -(a2*f2+a1*f1)/a3
327 REAL*8 FUNCTION endw2 (N,ALPHA,BETA)
328 IMPLICIT REAL*8 (a-h,o-z)
341 f1 = f1*(apb+two)*two**(apb+two)/two
347 fint1 = fint1*two**(apb+two)
349 fint2 = fint2*two**(apb+three)
350 f2 = (two*(alpha+two)*fint1 - (apb+four)*fint2)
360 a1 = -(two*(di+alpha)*(di+beta))/(abn*abnn*(abnn+one))
361 a2 = (two*(alpha-beta))/(abnn*(abnn+two))
362 a3 = (two*(abn+one))/((abnn+two)*(abnn+one))
363 f3 = -(a2*f2+a1*f1)/a3
372 IMPLICIT REAL*8 (a-h,o-z)
381 IF (x.EQ.-half)
gammaf = -two*sqrt(pi)
382 IF (x.EQ. half)
gammaf = sqrt(pi)
383 IF (x.EQ. one )
gammaf = one
384 IF (x.EQ. two )
gammaf = one
385 IF (x.EQ. 1.5 )
gammaf = sqrt(pi)/2.
386 IF (x.EQ. 2.5)
gammaf = 1.5*sqrt(pi)/2.
387 IF (x.EQ. 3.5)
gammaf = 0.5*(2.5*(1.5*sqrt(pi)))
388 IF (x.EQ. 3. )
gammaf = 2.
389 IF (x.EQ. 4. )
gammaf = 6.
390 IF (x.EQ. 5. )
gammaf = 24.
391 IF (x.EQ. 6. )
gammaf = 120.
396 IMPLICIT REAL*8 (a-h,o-z)
401 const = alpha+beta+one
405 pnormj = prod * two**const/(two*dn+const)
409 prod = prod/(two*(one+const)*
gammaf(const+one))
410 prod = prod*(one+alpha)*(two+alpha)
411 prod = prod*(one+beta)*(two+beta)
414 frac = (dindx+alpha)*(dindx+beta)/(dindx*(dindx+alpha+beta))
417 pnormj = prod * two**const/(two*dn+const)
421 SUBROUTINE jacg (XJAC,NP,ALPHA,BETA)
432 IMPLICIT REAL*8 (a-h,o-z)
438 dth = 4.*atan(one)/(2.*((n))+2.)
441 x = cos((2.*(((j))-1.)+1.)*dth)
443 x1 = cos((2.*(((j))-1.)+1.)*dth)
448 CALL jacobf (p,pd,pm1,pdm1,pm2,pdm2,np,alpha,beta,x)
452 recsum = recsum+1./(x-xjac(np-i+1))
454 delx = -p/(pd-recsum*p)
456 IF (abs(delx) .LT. eps)
GOTO 31
465 IF (xjac(j).LT.xmin)
THEN
479 SUBROUTINE jacobf (POLY,PDER,POLYM1,PDERM1,POLYM2,PDERM2,
487 IMPLICIT REAL*8 (a-h,o-z)
494 poly = (alp-bet+(apb+2.)*x)/2.
499 a1 = 2.*dk*(dk+apb)*(2.*dk+apb-2.)
500 a2 = (2.*dk+apb-1.)*(alp**2-bet**2)
502 a3 = b3*(b3+1.)*(b3+2.)
503 a4 = 2.*(dk+alp-1.)*(dk+bet-1.)*(2.*dk+apb)
504 polyn = ((a2+a3*x)*poly-a4*polyl)/a1
505 pdern = ((a2+a3*x)*pder-a4*pderl+a3*poly)/a1
520 REAL function
hgj (ii,z,zgj,np,alpha,beta)
529 parameter(lzd = nmax)
530 real*8 zd,zgjd(lzd),
hgjd,alphad,betad
531 REAL z,zgj(1),alpha,beta
533 IF (np.GT.npmax)
THEN
534 WRITE (6,*)
'Too large polynomial degree in HGJ'
535 WRITE (6,*)
'Maximum polynomial degree is',nmax
536 WRITE (6,*)
'Here NP=',np
545 hgj =
hgjd(ii,zd,zgjd,np,alphad,betad)
549 REAL*8 FUNCTION hgjd (II,Z,ZGJ,NP,ALPHA,BETA)
557 IMPLICIT REAL*8 (a-h,o-z)
558 real*8 z,zgj(1),alpha,beta
563 IF (abs(dz).LT.eps)
THEN
567 CALL jacobf (pzi,pdzi,pm1,pdm1,pm2,pdm2,np,alpha,beta,zi)
568 CALL jacobf (pz,pdz,pm1,pdm1,pm2,pdm2,np,alpha,beta,z)
569 hgjd = pz/(pdzi*(z-zi))
573 REAL function
hglj (ii,z,zglj,np,alpha,beta)
582 parameter(lzd = nmax)
583 real*8 zd,zgljd(lzd),
hgljd,alphad,betad
584 REAL z,zglj(1),alpha,beta
586 IF (np.GT.npmax)
THEN
587 WRITE (6,*)
'Too large polynomial degree in HGLJ'
588 WRITE (6,*)
'Maximum polynomial degree is',nmax
589 WRITE (6,*)
'Here NP=',np
598 hglj =
hgljd(ii,zd,zgljd,np,alphad,betad)
602 REAL*8 FUNCTION hgljd (I,Z,ZGLJ,NP,ALPHA,BETA)
610 IMPLICIT REAL*8 (a-h,o-z)
611 real*8 z,zglj(1),alpha,beta
616 IF (abs(dz).LT.eps)
THEN
622 eigval = -dn*(dn+alpha+beta+one)
623 CALL jacobf (pi,pdi,pm1,pdm1,pm2,pdm2,n,alpha,beta,zi)
624 const = eigval*pi+alpha*(one+zi)*pdi-beta*(one-zi)*pdi
625 CALL jacobf (p,pd,pm1,pdm1,pm2,pdm2,n,alpha,beta,z)
626 hgljd = (one-z**2)*pd/(const*(z-zi))
630 SUBROUTINE dgj (D,DT,Z,NZ,lzd,ALPHA,BETA)
641 parameter(lzdd = nmax)
642 real*8 dd(lzdd,lzdd),dtd(lzdd,lzdd),zd(lzdd),alphad,betad
643 REAL D(lzd,lzd),DT(lzd,lzd),Z(1),ALPHA,BETA
646 WRITE (6,*)
'DGJ: Minimum number of Gauss points is 1'
649 IF (nz .GT. nmax)
THEN
650 WRITE (6,*)
'Too large polynomial degree in DGJ'
651 WRITE (6,*)
'Maximum polynomial degree is',nmax
652 WRITE (6,*)
'Here Nz=',nz
655 IF ((alpha.LE.-1.).OR.(beta.LE.-1.))
THEN
656 WRITE (6,*)
'DGJ: Alpha and Beta must be greater than -1'
664 CALL dgjd (dd,dtd,zd,nz,lzdd,alphad,betad)
673 SUBROUTINE dgjd (D,DT,Z,NZ,lzd,ALPHA,BETA)
683 IMPLICIT REAL*8 (a-h,o-z)
684 real*8 d(lzd,lzd),dt(lzd,lzd),z(1),alpha,beta
691 WRITE (6,*)
'DGJD: Minimum number of Gauss-Lobatto points is 2'
694 IF ((alpha.LE.-one).OR.(beta.LE.-one))
THEN
695 WRITE (6,*)
'DGJD: Alpha and Beta must be greater than -1'
701 CALL jacobf (pi,pdi,pm1,pdm1,pm2,pdm2,nz,alpha,beta,z(i))
702 CALL jacobf (pj,pdj,pm1,pdm1,pm2,pdm2,nz,alpha,beta,z(j))
703 IF (i.NE.j) d(i,j) = pdi/(pdj*(z(i)-z(j)))
704 IF (i.EQ.j) d(i,j) = ((alpha+beta+two)*z(i)+alpha-beta)/
705 $ (two*(one-z(i)**2))
711 SUBROUTINE dglj (D,DT,Z,NZ,lzd,ALPHA,BETA)
722 parameter(lzdd = nmax)
723 real*8 dd(lzdd,lzdd),dtd(lzdd,lzdd),zd(lzdd),alphad,betad
724 REAL D(lzd,lzd),DT(lzd,lzd),Z(1),ALPHA,BETA
727 WRITE (6,*)
'DGLJ: Minimum number of Gauss-Lobatto points is 2'
730 IF (nz .GT. nmax)
THEN
731 WRITE (6,*)
'Too large polynomial degree in DGLJ'
732 WRITE (6,*)
'Maximum polynomial degree is',nmax
733 WRITE (6,*)
'Here NZ=',nz
736 IF ((alpha.LE.-1.).OR.(beta.LE.-1.))
THEN
737 WRITE (6,*)
'DGLJ: Alpha and Beta must be greater than -1'
745 CALL dgljd (dd,dtd,zd,nz,lzdd,alphad,betad)
754 SUBROUTINE dgljd (D,DT,Z,NZ,lzd,ALPHA,BETA)
764 IMPLICIT REAL*8 (a-h,o-z)
765 real*8 d(lzd,lzd),dt(lzd,lzd),z(1),alpha,beta
770 eigval = -dn*(dn+alpha+beta+one)
773 WRITE (6,*)
'DGLJD: Minimum number of Gauss-Lobatto points is 2'
776 IF ((alpha.LE.-one).OR.(beta.LE.-one))
THEN
777 WRITE (6,*)
'DGLJD: Alpha and Beta must be greater than -1'
783 CALL jacobf (pi,pdi,pm1,pdm1,pm2,pdm2,n,alpha,beta,z(i))
784 CALL jacobf (pj,pdj,pm1,pdm1,pm2,pdm2,n,alpha,beta,z(j))
785 ci = eigval*pi-(beta*(one-z(i))-alpha*(one+z(i)))*pdi
786 cj = eigval*pj-(beta*(one-z(j))-alpha*(one+z(j)))*pdj
787 IF (i.NE.j) d(i,j) = ci/(cj*(z(i)-z(j)))
788 IF ((i.EQ.j).AND.(i.NE.1).AND.(i.NE.nz))
789 $ d(i,j) = (alpha*(one+z(i))-beta*(one-z(i)))/
790 $ (two*(one-z(i)**2))
791 IF ((i.EQ.j).AND.(i.EQ.1))
792 $ d(i,j) = (eigval+alpha)/(two*(beta+two))
793 IF ((i.EQ.j).AND.(i.EQ.nz))
794 $ d(i,j) = -(eigval+beta)/(two*(alpha+two))
800 SUBROUTINE dgll (D,DT,Z,NZ,lzd)
810 REAL D(lzd,lzd),DT(lzd,lzd),Z(1)
812 IF (nz .GT. nmax)
THEN
813 WRITE (6,*)
'Subroutine DGLL'
814 WRITE (6,*)
'Maximum polynomial degree =',nmax
815 WRITE (6,*)
'Polynomial degree =',nz
826 IF (i.NE.j) d(i,j) =
pnleg(z(i),n)/
827 $ (
pnleg(z(j),n)*(z(i)-z(j)))
828 IF ((i.EQ.j).AND.(i.EQ.1)) d(i,j) = -d0
829 IF ((i.EQ.j).AND.(i.EQ.nz)) d(i,j) = d0
835 REAL function
hgll (i,z,zgll,nz)
845 IF (abs(dz) .LT. eps)
THEN
852 $ (alfan*
pnleg(zgll(i),n)*(z-zgll(i)))
856 REAL function
hgl (i,z,zgl,nz)
866 IF (abs(dz) .LT. eps)
THEN
887 IF(abs(z) .LT. 1.0e-25) z = 0.0
898 p3 = ((2.*fk+1.)*z*p2 - fk*p1)/(fk+1.)
903 if (n.eq.0)
pnleg = 1.
922 p3 = ((2.*fk+1.)*z*p2 - fk*p1)/(fk+1.)
923 p3d = ((2.*fk+1.)*p2 + (2.*fk+1.)*z*p2d - fk*p1d)/(fk+1.)
934 SUBROUTINE dgllgl (D,DT,ZM1,ZM2,IM12,NZM1,NZM2,ND1,ND2)
946 REAL D(ND2,ND1), DT(ND1,ND2), ZM1(ND1), ZM2(ND2), IM12(ND2,ND1)
958 IF ((abs(zp) .LT. eps).AND.(abs(zq) .LT. eps))
THEN
962 $ -im12(ip,jq))/(zp-zq)
969 SUBROUTINE dgljgj (D,DT,ZGL,ZG,IGLG,NPGL,NPG,ND1,ND2,ALPHA,BETA)
982 REAL D(ND2,ND1), DT(ND1,ND2), ZGL(ND1), ZG(ND2), IGLG(ND2,ND1)
984 parameter(ndd = nmax)
985 real*8 dd(ndd,ndd), dtd(ndd,ndd)
986 real*8 zgd(ndd), zgld(ndd), iglgd(ndd,ndd)
990 WRITE(6,*)
'DGLJGJ: Minimum number of Gauss-Lobatto points is 2'
993 IF (npgl.GT.nmax)
THEN
994 WRITE(6,*)
'Polynomial degree too high in DGLJGJ'
995 WRITE(6,*)
'Maximum polynomial degree is',nmax
996 WRITE(6,*)
'Here NPGL=',npgl
999 IF ((alpha.LE.-1.).OR.(beta.LE.-1.))
THEN
1000 WRITE(6,*)
'DGLJGJ: Alpha and Beta must be greater than -1'
1009 iglgd(i,j) = iglg(i,j)
1014 CALL dgljgjd (dd,dtd,zgld,zgd,iglgd,npgl,npg,ndd,ndd,alphad,betad)
1023 SUBROUTINE dgljgjd (D,DT,ZGL,ZG,IGLG,NPGL,NPG,ND1,ND2,ALPHA,BETA)
1036 IMPLICIT REAL*8 (a-h,o-z)
1037 real*8 d(nd2,nd1), dt(nd1,nd2), zgl(nd1), zg(nd2)
1038 real*8 iglg(nd2,nd1), alpha, beta
1041 WRITE(6,*)
'DGLJGJD: Minimum number of Gauss-Lobatto points is 2'
1044 IF ((alpha.LE.-1.).OR.(beta.LE.-1.))
THEN
1045 WRITE(6,*)
'DGLJGJD: Alpha and Beta must be greater than -1'
1054 eigval = -dn*(dn+alpha+beta+one)
1058 dz = abs(zg(i)-zgl(j))
1060 d(i,j) = (alpha*(one+zg(i))-beta*(one-zg(i)))/
1061 $ (two*(one-zg(i)**2))
1063 CALL jacobf (pi,pdi,pm1,pdm1,pm2,pdm2,ngl,alpha,beta,zg(i))
1064 CALL jacobf (pj,pdj,pm1,pdm1,pm2,pdm2,ngl,alpha,beta,zgl(j))
1065 faci = alpha*(one+zg(i))-beta*(one-zg(i))
1066 facj = alpha*(one+zgl(j))-beta*(one-zgl(j))
1067 const = eigval*pj+facj*pdj
1068 d(i,j) = ((eigval*pi+faci*pdi)*(zg(i)-zgl(j))
1069 $ -(one-zg(i)**2)*pdi)/(const*(zg(i)-zgl(j))**2)
1076 SUBROUTINE iglm (I12,IT12,Z1,Z2,lz1,lz2,ND1,ND2)
1086 REAL I12(ND2,ND1),IT12(ND1,ND2),Z1(ND1),Z2(ND2)
1087 IF (lz1 .EQ. 1)
THEN
1095 i12(i,j) =
hgl(j,zi,z1,lz1)
1096 it12(j,i) = i12(i,j)
1101 SUBROUTINE igllm (I12,IT12,Z1,Z2,lz1,lz2,ND1,ND2)
1111 REAL I12(ND2,ND1),IT12(ND1,ND2),Z1(ND1),Z2(ND2)
1112 IF (lz1 .EQ. 1)
THEN
1120 i12(i,j) =
hgll(j,zi,z1,lz1)
1121 it12(j,i) = i12(i,j)
1126 SUBROUTINE igjm (I12,IT12,Z1,Z2,lz1,lz2,ND1,ND2,ALPHA,BETA)
1137 REAL I12(ND2,ND1),IT12(ND1,ND2),Z1(ND1),Z2(ND2)
1138 IF (lz1 .EQ. 1)
THEN
1146 i12(i,j) =
hgj(j,zi,z1,lz1,alpha,beta)
1147 it12(j,i) = i12(i,j)
1152 SUBROUTINE igljm (I12,IT12,Z1,Z2,lz1,lz2,ND1,ND2,ALPHA,BETA)
1163 REAL I12(ND2,ND1),IT12(ND1,ND2),Z1(ND1),Z2(ND2)
1164 IF (lz1 .EQ. 1)
THEN
1172 i12(i,j) =
hglj(j,zi,z1,lz1,alpha,beta)
1173 it12(j,i) = i12(i,j)
subroutine swap(b, ind, n, temp)
real function pndleg(Z, N)
real *8 function hgljd(I, Z, ZGLJ, NP, ALPHA, BETA)
subroutine zwglj(Z, W, NP, ALPHA, BETA)
real function hgl(I, Z, ZGL, NZ)
subroutine zwgl(Z, W, NP)
subroutine dglj(D, DT, Z, NZ, lzd, ALPHA, BETA)
subroutine zwgljd(Z, W, NP, ALPHA, BETA)
subroutine dgljgjd(D, DT, ZGL, ZG, IGLG, NPGL, NPG, ND1, ND2, ALPHA, BETA)
subroutine dgjd(D, DT, Z, NZ, lzd, ALPHA, BETA)
subroutine zwgll(Z, W, NP)
real function hglj(II, Z, ZGLJ, NP, ALPHA, BETA)
subroutine dgljd(D, DT, Z, NZ, lzd, ALPHA, BETA)
subroutine iglm(I12, IT12, Z1, Z2, lz1, lz2, ND1, ND2)
real *8 function gammaf(X)
subroutine zwgjd(Z, W, NP, ALPHA, BETA)
subroutine igljm(I12, IT12, Z1, Z2, lz1, lz2, ND1, ND2, ALPHA, BETA)
subroutine jacobf(POLY, PDER, POLYM1, PDERM1, POLYM2, PDERM2, N, ALP, BET, X)
real *8 function endw1(N, ALPHA, BETA)
subroutine dgllgl(D, DT, ZM1, ZM2, IM12, NZM1, NZM2, ND1, ND2)
real function pnleg(Z, N)
subroutine igllm(I12, IT12, Z1, Z2, lz1, lz2, ND1, ND2)
real function hgj(II, Z, ZGJ, NP, ALPHA, BETA)
subroutine jacg(XJAC, NP, ALPHA, BETA)
subroutine dgj(D, DT, Z, NZ, lzd, ALPHA, BETA)
real *8 function pnormj(N, ALPHA, BETA)
subroutine igjm(I12, IT12, Z1, Z2, lz1, lz2, ND1, ND2, ALPHA, BETA)
real *8 function hgjd(II, Z, ZGJ, NP, ALPHA, BETA)
real *8 function endw2(N, ALPHA, BETA)
subroutine dgll(D, DT, Z, NZ, lzd)
subroutine zwgj(Z, W, NP, ALPHA, BETA)
real function hgll(I, Z, ZGLL, NZ)
subroutine dgljgj(D, DT, ZGL, ZG, IGLG, NPGL, NPG, ND1, ND2, ALPHA, BETA)