262 SUBROUTINE calctmat(AXI,RAT,LAM,MRR,MRI,EPS,NP,DDELT,NDGS,NMAX)
263 IMPLICIT REAL*8 (a-h,o-z)
276 include
'ampld.par.f'
277 real*8 lam,mrr,mri,x(npng2),w(npng2),s(npng2),ss(npng2),
278 * an(npn1),r(npng2),dr(npng2),
279 * ddr(npng2),drr(npng2),dri(npng2),ann(npn1,npn1)
280 real*8 tr1(npn2,npn2),ti1(npn2,npn2)
281 real*8 xalpha(300),xbeta(300),walpha(300),wbeta(300)
283 & rt11(npn6,npn4,npn4),rt12(npn6,npn4,npn4),
284 & rt21(npn6,npn4,npn4),rt22(npn6,npn4,npn4),
285 & it11(npn6,npn4,npn4),it12(npn6,npn4,npn4),
286 & it21(npn6,npn4,npn4),it22(npn6,npn4,npn4)
289 COMMON /tmat/ rt11,rt12,rt21,rt22,it11,it12,it21,it22
290 COMMON /choice/ ichoice
310 IF (np.EQ.-1.OR.np.EQ.-2) ncheck=1
311 IF (np.GT.0.AND.(-1)**np.EQ.1) ncheck=1
314 IF (dabs(rat-1d0).GT.1d-8.AND.np.EQ.-1)
CALL sarea (eps,rat)
315 IF (dabs(rat-1d0).GT.1d-8.AND.np.GE.0)
CALL surfch(np,eps,rat)
316 IF (dabs(rat-1d0).GT.1d-8.AND.np.EQ.-2)
CALL sareac (eps,rat)
317 IF (np.EQ.-3)
CALL drop (rat)
344 ixxx=xev+4.05d0*xev**0.333333d0
347 IF (inm1.GE.npn1) stop
357 IF (ngauss.GT.npng1) stop
361 CALL const(ngauss,nmax,mmax,p,x,w,an,ann,s,ss,np,eps)
362 CALL vary(lam,mrr,mri,a,eps,np,ngauss,x,p,ppi,pir,pii,r,
363 & dr,ddr,drr,dri,nmax)
364 CALL tmatr0 (ngauss,x,w,an,ann,s,ss,ppi,pir,pii,r,dr,
365 & ddr,drr,dri,nmax,ncheck)
375 qsca=qsca+dn1*(tr1nn*tr1nn+ti1nn*ti1nn
376 & +tr1nn1*tr1nn1+ti1nn1*ti1nn1)
377 qext=qext+(tr1nn+tr1nn1)*dn1
379 dsca=dabs((qsca1-qsca)/qsca)
380 dext=dabs((qext1-qext)/qext)
384 IF(dsca.LE.ddelt.AND.dext.LE.ddelt)
GO TO 55
386 IF (nma.EQ.npn1) stop
391 IF (ngauss.EQ.npng1)
GO TO 155
392 DO 150 ngaus=nnnggg,npng1
397 CALL const(ngauss,nmax,mmax,p,x,w,an,ann,s,ss,np,eps)
398 CALL vary(lam,mrr,mri,a,eps,np,ngauss,x,p,ppi,pir,pii,r,
399 & dr,ddr,drr,dri,nmax)
400 CALL tmatr0 (ngauss,x,w,an,ann,s,ss,ppi,pir,pii,r,dr,
401 & ddr,drr,dri,nmax,ncheck)
411 qsca=qsca+dn1*(tr1nn*tr1nn+ti1nn*ti1nn
412 & +tr1nn1*tr1nn1+ti1nn1*ti1nn1)
413 qext=qext+(tr1nn+tr1nn1)*dn1
415 dsca=dabs((qsca1-qsca)/qsca)
416 dext=dabs((qext1-qext)/qext)
420 IF(dsca.LE.ddelt.AND.dext.LE.ddelt)
GO TO 155
450 qsca=qsca+zz1*zz1+zz2*zz2+zz3*zz3+zz4*zz4
451 & +zz5*zz5+zz6*zz6+zz7*zz7+zz8*zz8
455 CALL tmatr(m,ngauss,x,w,an,ann,s,ss,ppi,pir,pii,r,dr,
456 & ddr,drr,dri,nmax,ncheck)
482 qsc=qsc+(zz1*zz1+zz2*zz2+zz3*zz3+zz4*zz4
483 & +zz5*zz5+zz6*zz6+zz7*zz7+zz8*zz8)*2d0
511 SUBROUTINE calcampl(NMAX,LAM,THET0,THET,PHI0,PHI,ALPHA,BETA,S,Z)
512 IMPLICIT REAL*8 (a-h,o-z)
528 CALL ampl (nmax,lam,thet0,thet,phi0,phi,alpha,beta,
529 & s(1,1),s(1,2),s(2,1),s(2,2))
531 z(1,1)=0.5d0*(s(1,1)*dconjg(s(1,1))+s(1,2)*dconjg(s(1,2))
532 & +s(2,1)*dconjg(s(2,1))+s(2,2)*dconjg(s(2,2)))
533 z(1,2)=0.5d0*(s(1,1)*dconjg(s(1,1))-s(1,2)*dconjg(s(1,2))
534 & +s(2,1)*dconjg(s(2,1))-s(2,2)*dconjg(s(2,2)))
535 z(1,3)=-s(1,1)*dconjg(s(1,2))-s(2,2)*dconjg(s(2,1))
536 z(1,4)=(0d0,1d0)*(s(1,1)*dconjg(s(1,2))-s(2,2)*dconjg(s(2,1)))
537 z(2,1)=0.5d0*(s(1,1)*dconjg(s(1,1))+s(1,2)*dconjg(s(1,2))
538 & -s(2,1)*dconjg(s(2,1))-s(2,2)*dconjg(s(2,2)))
539 z(2,2)=0.5d0*(s(1,1)*dconjg(s(1,1))-s(1,2)*dconjg(s(1,2))
540 & -s(2,1)*dconjg(s(2,1))+s(2,2)*dconjg(s(2,2)))
541 z(2,3)=-s(1,1)*dconjg(s(1,2))+s(2,2)*dconjg(s(2,1))
542 z(2,4)=(0d0,1d0)*(s(1,1)*dconjg(s(1,2))+s(2,2)*dconjg(s(2,1)))
543 z(3,1)=-s(1,1)*dconjg(s(2,1))-s(2,2)*dconjg(s(1,2))
544 z(3,2)=-s(1,1)*dconjg(s(2,1))+s(2,2)*dconjg(s(1,2))
545 z(3,3)=s(1,1)*dconjg(s(2,2))+s(1,2)*dconjg(s(2,1))
546 z(3,4)=(0d0,-1d0)*(s(1,1)*dconjg(s(2,2))+s(2,1)*dconjg(s(1,2)))
547 z(4,1)=(0d0,1d0)*(s(2,1)*dconjg(s(1,1))+s(2,2)*dconjg(s(1,2)))
548 z(4,2)=(0d0,1d0)*(s(2,1)*dconjg(s(1,1))-s(2,2)*dconjg(s(1,2)))
549 z(4,3)=(0d0,-1d0)*(s(2,2)*dconjg(s(1,1))-s(1,2)*dconjg(s(2,1)))
550 z(4,4)=s(2,2)*dconjg(s(1,1))-s(1,2)*dconjg(s(2,1))
572 SUBROUTINE ampl (NMAX,DLAM,TL,TL1,PL,PL1,ALPHA,BETA,
575 IMPLICIT REAL*8 (a-b,d-h,o-z),
COMPLEX*16 (C)
576 real*8 al(3,2),al1(3,2),ap(2,3),ap1(2,3),b(3,3),
577 * r(2,2),r1(2,2),c(3,2),ca,cb,ct,cp,ctp,cpp,ct1,cp1,
579 real*8 dv1(npn6),dv2(npn6),dv01(npn6),dv02(npn6)
581 & tr11(npn6,npn4,npn4),tr12(npn6,npn4,npn4),
582 & tr21(npn6,npn4,npn4),tr22(npn6,npn4,npn4),
583 & ti11(npn6,npn4,npn4),ti12(npn6,npn4,npn4),
584 & ti21(npn6,npn4,npn4),ti22(npn6,npn4,npn4)
585 COMPLEX*16 CAL(NPN4,NPN4),VV,VH,HV,HH
586 COMMON /tmat/ tr11,tr12,tr21,tr22,ti11,ti12,ti21,ti22
588 IF (alpha.LT.0d0.OR.alpha.GT.360d0.OR.
589 & beta.LT.0d0.OR.beta.GT.180d0.OR.
590 & tl.LT.0d0.OR.tl.GT.180d0.OR.
591 & tl1.LT.0d0.OR.tl1.GT.180d0.OR.
592 & pl.LT.0d0.OR.pl.GT.360d0.OR.
593 & pl1.LT.0d0.OR.pl1.GT.360d0)
THEN
612 IF (thetl.LT.pin2) thetl=thetl+eps
613 IF (thetl.GT.pin2) thetl=thetl-eps
614 IF (thetl1.LT.pin2) thetl1=thetl1+eps
615 IF (thetl1.GT.pin2) thetl1=thetl1-eps
616 IF (phil.LT.pin) phil=phil+eps
617 IF (phil.GT.pin) phil=phil-eps
618 IF (phil1.LT.pin) phil1=phil1+eps
619 IF (phil1.GT.pin) phil1=phil1-eps
620 IF (bet.LE.pin2.AND.pin2-bet.LE.eps) bet=bet-eps
621 IF (bet.GT.pin2.AND.bet-pin2.LE.eps) bet=bet+eps
636 IF (phip.GT.0d0.AND.sp.LT.0d0) phip=phip+pin
637 IF (phip.LT.0d0.AND.sp.GT.0d0) phip=phip+pin
638 IF (phip.LT.0d0) phip=phip+2d0*pin
644 ctp1=ct1*cb+st1*sb*cp1
646 cpp1=cb*st1*cp1-sb*ct1
648 phip1=datan(spp1/cpp1)
649 IF (phip1.GT.0d0.AND.sp1.LT.0d0) phip1=phip1+pin
650 IF (phip1.LT.0d0.AND.sp1.GT.0d0) phip1=phip1+pin
651 IF (phip1.LT.0d0) phip1=phip1+2d0*pin
746 d=1d0/(r1(1,1)*r1(2,2)-r1(1,2)*r1(2,1))
757 dnn=dfloat((2*n+1)*(2*nn+1))
758 dnn=dnn/dfloat( n*nn*(n+1)*(nn+1) )
772 CALL vigampl (dcth, nmax, m, dv1, dv2)
773 CALL vigampl (dcth0, nmax, m, dv01, dv02)
783 ct11=dcmplx(tr11(m1,n,nn),ti11(m1,n,nn))
784 ct22=dcmplx(tr22(m1,n,nn),ti22(m1,n,nn))
788 cn=cal(n,nn)*dv2n*dv2nn
795 ct12=dcmplx(tr12(m1,n,nn),ti12(m1,n,nn))
796 ct21=dcmplx(tr21(m1,n,nn),ti21(m1,n,nn))
806 vv=vv+(ct11*d11+ct21*d21
807 & +ct12*d12+ct22*d22)*cn1
809 vh=vh+(ct11*d12+ct21*d22
810 & +ct12*d11+ct22*d21)*cn2
812 hv=hv-(ct11*d21+ct21*d11
813 & +ct12*d22+ct22*d12)*cn2
815 hh=hh+(ct11*d22+ct21*d12
816 & +ct12*d21+ct22*d11)*cn1
825 cvv=vv*r(1,1)+vh*r(2,1)
826 cvh=vv*r(1,2)+vh*r(2,2)
827 chv=hv*r(1,1)+hh*r(2,1)
828 chh=hv*r(1,2)+hh*r(2,2)
829 vv=r1(1,1)*cvv+r1(1,2)*chv
830 vh=r1(1,1)*cvh+r1(1,2)*chh
831 hv=r1(2,1)*cvv+r1(2,2)*chv
832 hh=r1(2,1)*cvh+r1(2,2)*chh
859 SUBROUTINE vigampl (X, NMAX, M, DV1, DV2)
860 include
'ampld.par.f'
861 IMPLICIT REAL*8 (a-h,o-z)
862 real*8 dv1(npn6), dv2(npn6)
868 IF (dabs(1d0-dx).LE.1d-10)
GO TO 100
880 d3=(qn2*x*d2-qn*d1)/qn1
881 der=qs1*(qn1*qn/qn2)*(-d1+d3)
891 a=a*dsqrt(dfloat(i2-1)/dfloat(i2))*qs
900 qnm1=dsqrt(qn1*qn1-qmm)
901 d3=(qn2*x*d2-qnm*d1)/qnm1
902 der=qs1*(-qn1*qnm*d1+qn*qnm1*d3)/qn2
909 100
IF (m.NE.1)
RETURN
913 IF (x.LT.0d0) dn=dn*(-1)**(n+1)
923 SUBROUTINE const (NGAUSS,NMAX,MMAX,P,X,W,AN,ANN,S,SS,NP,EPS)
924 IMPLICIT REAL*8 (a-h,o-z)
925 include
'ampld.par.f'
926 real*8 x(npng2),w(npng2),x1(npng1),w1(npng1),
927 * x2(npng1),w2(npng1),
928 * s(npng2),ss(npng2),
929 * an(npn1),ann(npn1,npn1),dd(npn1)
934 d=dsqrt(dfloat(2*n+1)/dfloat(nn))
942 IF (np.EQ.-2)
GO TO 11
943 CALL gauss(ng,0,0,x,w)
945 11 ng1=dfloat(ngauss)/2d0
948 CALL gauss(ng1,0,0,x1,w1)
949 CALL gauss(ng2,0,0,x2,w2)
951 w(i)=0.5d0*(xx+1d0)*w1(i)
952 x(i)=0.5d0*(xx+1d0)*x1(i)+0.5d0*(xx-1d0)
955 w(i+ng1)=-0.5d0*xx*w2(i)
956 x(i+ng1)=-0.5d0*xx*x2(i)+0.5d0*xx
976 SUBROUTINE vary (LAM,MRR,MRI,A,EPS,NP,NGAUSS,X,P,PPI,PIR,PII,
977 * R,DR,DDR,DRR,DRI,NMAX)
978 include
'ampld.par.f'
979 IMPLICIT REAL*8 (a-h,o-z)
980 real*8 x(npng2),r(npng2),dr(npng2),mrr,mri,lam,
981 * z(npng2),zr(npng2),zi(npng2),
982 * j(npng2,npn1),y(npng2,npn1),jr(npng2,npn1),
983 * ji(npng2,npn1),dj(npng2,npn1),
984 * djr(npng2,npn1),dji(npng2,npn1),ddr(npng2),
985 * drr(npng2),dri(npng2),
987 COMMON /cbess/ j,y,jr,ji,dj,dy,djr,dji
989 IF (np.GT.0)
CALL rsp2(x,ng,a,eps,np,r,dr)
990 IF (np.EQ.-1)
CALL rsp1(x,ng,ngauss,a,eps,np,r,dr)
991 IF (np.EQ.-2)
CALL rsp3(x,ng,ngauss,a,eps,r,dr)
992 IF (np.EQ.-3)
CALL rsp4(x,ng,a,r,dr)
997 v=1d0/(mrr*mrr+mri*mri)
1016 IF (nmax.GT.npn1) stop
1018 tb=ta*dsqrt(mrr*mrr+mri*mri)
1019 tb=dmax1(tb,dfloat(nmax))
1020 nnmax1=1.2d0*dsqrt(dmax1(ta,dfloat(nmax)))+3d0
1021 nnmax2=(tb+4d0*(tb**0.33333d0)+1.2d0*dsqrt(tb))
1022 nnmax2=nnmax2-nmax+5
1023 CALL bess(z,zr,zi,ng,nmax,nnmax1,nnmax2)
1029 SUBROUTINE rsp1 (X,NG,NGAUSS,REV,EPS,NP,R,DR)
1030 IMPLICIT REAL*8 (a-h,o-z)
1031 real*8 x(ng),r(ng),dr(ng)
1032 a=rev*eps**(1d0/3d0)
1052 SUBROUTINE rsp2 (X,NG,REV,EPS,N,R,DR)
1053 IMPLICIT REAL*8 (a-h,o-z)
1054 real*8 x(ng),r(ng),dr(ng)
1059 a=1d0+1.5d0*ep*(dn4-2d0)/(dn4-1d0)
1062 IF (i.EQ.n) a=a-3d0*eps*(1d0+0.25d0*ep)/
1063 * (dn-1d0)-0.25d0*ep*eps/(9d0*dn-1d0)
1064 r0=rev*a**(-1d0/3d0)
1067 ri=r0*(1d0+eps*dcos(xi))
1069 dr(i)=-r0*eps*dnp*dsin(xi)/ri
1077 SUBROUTINE rsp3 (X,NG,NGAUSS,REV,EPS,R,DR)
1078 IMPLICIT REAL*8 (a-h,o-z)
1079 real*8 x(ng),r(ng),dr(ng)
1080 h=rev*( (2d0/(3d0*eps*eps))**(1d0/3d0) )
1085 IF (si/co.GT.a/h)
GO TO 20
1111 SUBROUTINE rsp4 (X,NG,REV,R,DR)
1113 IMPLICIT REAL*8 (a-h,o-z)
1114 real*8 x(ng),r(ng),dr(ng),c(0:nc)
1115 COMMON /cdrop/ c,r0v
1123 ri=ri+c(n)*dcos(xin)
1124 dri=dri-c(n)*n*dsin(xin)
1137 SUBROUTINE bess (X,XR,XI,NG,NMAX,NNMAX1,NNMAX2)
1138 include
'ampld.par.f'
1139 IMPLICIT REAL*8 (a-h,o-z)
1140 real*8 x(ng),xr(ng),xi(ng),
1141 * j(npng2,npn1),y(npng2,npn1),jr(npng2,npn1),
1142 * ji(npng2,npn1),dj(npng2,npn1),dy(npng2,npn1),
1143 * djr(npng2,npn1),dji(npng2,npn1),
1144 * aj(npn1),ay(npn1),ajr(npn1),aji(npn1),
1145 * adj(npn1),ady(npn1),adjr(npn1),
1147 COMMON /cbess/ j,y,jr,ji,dj,dy,djr,dji
1151 CALL rjb(xx,aj,adj,nmax,nnmax1)
1152 CALL ryb(xx,ay,ady,nmax)
1155 CALL cjb(yr,yi,ajr,aji,adjr,adji,nmax,nnmax2)
1171 SUBROUTINE rjb(X,Y,U,NMAX,NNMAX)
1172 IMPLICIT REAL*8 (a-h,o-z)
1173 real*8 y(nmax),u(nmax),z(800)
1176 z(l)=1d0/(dfloat(2*l+1)*xx)
1180 z(i1)=1d0/(dfloat(2*i1+1)*xx-z(i1+1))
1190 u(i)=yi1-dfloat(i)*yi*xx
1198 SUBROUTINE ryb(X,Y,V,NMAX)
1199 IMPLICIT REAL*8 (a-h,o-z)
1200 real*8 y(nmax),v(nmax)
1208 y(2)=(-3d0*x3+x1)*c-3d0*x2*s
1211 5 y(i+1)=dfloat(2*i+1)*x1*y(i)-y(i-1)
1214 10 v(i)=y(i-1)-dfloat(i)*x1*y(i)
1227 SUBROUTINE cjb (XR,XI,YR,YI,UR,UI,NMAX,NNMAX)
1228 include
'ampld.par.f'
1229 IMPLICIT REAL*8 (a-h,o-z)
1230 real*8 yr(nmax),yi(nmax),ur(nmax),ui(nmax)
1231 real*8 cyr(npn1),cyi(npn1),czr(1200),czi(1200),
1232 * cur(npn1),cui(npn1)
1234 xrxi=1d0/(xr*xr+xi*xi)
1237 qf=1d0/dfloat(2*l+1)
1244 ar=qf*cxxr-czr(i1+1)
1245 ai=qf*cxxi-czi(i1+1)
1246 ari=1d0/(ar*ar+ai*ai)
1252 ari=1d0/(ar*ar+ai*ai)
1255 cr=dcos(xr)*dcosh(xi)
1256 ci=-dsin(xr)*dsinh(xi)
1259 cy0r=ar*cxxr-ai*cxxi
1260 cy0i=ai*cxxr+ar*cxxi
1261 cy1r=cy0r*czr(1)-cy0i*czi(1)
1262 cy1i=cy0i*czr(1)+cy0r*czi(1)
1263 ar=cy1r*cxxr-cy1i*cxxi
1264 ai=cy1i*cxxr+cy1r*cxxi
1279 cyir=cyi1r*czr(i)-cyi1i*czi(i)
1280 cyii=cyi1i*czr(i)+cyi1r*czi(i)
1281 ar=cyir*cxxr-cyii*cxxi
1282 ai=cyii*cxxr+cyir*cxxi
1299 SUBROUTINE tmatr0 (NGAUSS,X,W,AN,ANN,S,SS,PPI,PIR,PII,R,DR,DDR,
1300 * DRR,DRI,NMAX,NCHECK)
1301 include
'ampld.par.f'
1302 IMPLICIT REAL*8 (a-h,o-z)
1303 real*8 x(npng2),w(npng2),an(npn1),s(npng2),ss(npng2),
1304 * r(npng2),dr(npng2),sig(npn2),
1305 * j(npng2,npn1),y(npng2,npn1),
1306 * jr(npng2,npn1),ji(npng2,npn1),dj(npng2,npn1),
1307 * dy(npng2,npn1),djr(npng2,npn1),
1308 * dji(npng2,npn1),ddr(npng2),drr(npng2),
1309 * d1(npng2,npn1),d2(npng2,npn1),
1310 * dri(npng2),ds(npng2),dss(npng2),rr(npng2),
1311 * dv1(npn1),dv2(npn1)
1313 real*8 r11(npn1,npn1),r12(npn1,npn1),
1314 * r21(npn1,npn1),r22(npn1,npn1),
1315 * i11(npn1,npn1),i12(npn1,npn1),
1316 * i21(npn1,npn1),i22(npn1,npn1),
1317 * rg11(npn1,npn1),rg12(npn1,npn1),
1318 * rg21(npn1,npn1),rg22(npn1,npn1),
1319 * ig11(npn1,npn1),ig12(npn1,npn1),
1320 * ig21(npn1,npn1),ig22(npn1,npn1),
1322 * qr(npn2,npn2),qi(npn2,npn2),
1323 * rgqr(npn2,npn2),rgqi(npn2,npn2),
1324 * tqr(npn2,npn2),tqi(npn2,npn2),
1325 * trgqr(npn2,npn2),trgqi(npn2,npn2)
1326 real*8 tr1(npn2,npn2),ti1(npn2,npn2)
1328 & r11,r12,r21,r22,i11,i12,i21,i22,rg11,rg12,rg21,rg22,
1329 & ig11,ig12,ig21,ig22
1330 COMMON /cbess/ j,y,jr,ji,dj,dy,djr,dji
1332 COMMON /ctt/ qr,qi,rgqr,rgqi
1338 IF (ncheck.EQ.1)
THEN
1352 CALL vig ( x(i1), nmax, 0, dv1, dv2)
1378 IF (ncheck.EQ.1.AND.sig(n1+n2).LT.0d0)
GO TO 205
1422 c5r=c1r*drri-c1i*drii
1423 c5i=c1i*drri+c1r*drii
1424 b5r=b1r*drri-b1i*drii
1425 b5i=b1i*drri+b1r*drii
1432 ar12=ar12+
f1*b2r+
f2*b3r
1433 ai12=ai12+
f1*b2i+
f2*b3i
1434 gr12=gr12+
f1*c2r+
f2*c3r
1435 gi12=gi12+
f1*c2i+
f2*c3i
1438 ar21=ar21+
f1*b4r+
f2*b5r
1439 ai21=ai21+
f1*b4i+
f2*b5i
1440 gr21=gr21+
f1*c4r+
f2*c5r
1441 gi21=gi21+
f1*c4i+
f2*c5i
1444 205 an12=ann(n1,n2)*factor
1445 r12(n1,n2)=ar12*an12
1446 r21(n1,n2)=ar21*an12
1447 i12(n1,n2)=ai12*an12
1448 i21(n1,n2)=ai21*an12
1449 rg12(n1,n2)=gr12*an12
1450 rg21(n1,n2)=gr21*an12
1451 ig12(n1,n2)=gi12*an12
1452 ig21(n1,n2)=gi21*an12
1477 tqr(k1,k2)=tpir*tar21-tpii*tai21+tppi*tar12
1478 tqi(k1,k2)=tpir*tai21+tpii*tar21+tppi*tai12
1479 trgqr(k1,k2)=tpir*tgr21-tpii*tgi21+tppi*tgr12
1480 trgqi(k1,k2)=tpir*tgi21+tpii*tgr21+tppi*tgi12
1492 tqr(kk1,kk2)=tpir*tar12-tpii*tai12+tppi*tar21
1493 tqi(kk1,kk2)=tpir*tai12+tpii*tar12+tppi*tai21
1494 trgqr(kk1,kk2)=tpir*tgr12-tpii*tgi12+tppi*tgr21
1495 trgqi(kk1,kk2)=tpir*tgi12+tpii*tgr12+tppi*tgi21
1501 qr(n1,n2)=tqr(n1,n2)
1502 qi(n1,n2)=tqi(n1,n2)
1503 rgqr(n1,n2)=trgqr(n1,n2)
1504 rgqi(n1,n2)=trgqi(n1,n2)
1506 CALL tt(nmax,ncheck)
1512 SUBROUTINE tmatr (M,NGAUSS,X,W,AN,ANN,S,SS,PPI,PIR,PII,R,DR,DDR,
1513 * DRR,DRI,NMAX,NCHECK)
1514 include
'ampld.par.f'
1515 IMPLICIT REAL*8 (a-h,o-z)
1516 real*8 x(npng2),w(npng2),an(npn1),s(npng2),ss(npng2),
1517 * r(npng2),dr(npng2),sig(npn2),
1518 * j(npng2,npn1),y(npng2,npn1),
1519 * jr(npng2,npn1),ji(npng2,npn1),dj(npng2,npn1),
1520 * dy(npng2,npn1),djr(npng2,npn1),
1521 * dji(npng2,npn1),ddr(npng2),drr(npng2),
1522 * d1(npng2,npn1),d2(npng2,npn1),
1523 * dri(npng2),ds(npng2),dss(npng2),rr(npng2),
1524 * dv1(npn1),dv2(npn1)
1526 real*8 r11(npn1,npn1),r12(npn1,npn1),
1527 * r21(npn1,npn1),r22(npn1,npn1),
1528 * i11(npn1,npn1),i12(npn1,npn1),
1529 * i21(npn1,npn1),i22(npn1,npn1),
1530 * rg11(npn1,npn1),rg12(npn1,npn1),
1531 * rg21(npn1,npn1),rg22(npn1,npn1),
1532 * ig11(npn1,npn1),ig12(npn1,npn1),
1533 * ig21(npn1,npn1),ig22(npn1,npn1),
1535 * qr(npn2,npn2),qi(npn2,npn2),
1536 * rgqr(npn2,npn2),rgqi(npn2,npn2),
1537 * tqr(npn2,npn2),tqi(npn2,npn2),
1538 * trgqr(npn2,npn2),trgqi(npn2,npn2)
1539 real*8 tr1(npn2,npn2),ti1(npn2,npn2)
1541 & r11,r12,r21,r22,i11,i12,i21,i22,rg11,rg12,rg21,rg22,
1542 & ig11,ig12,ig21,ig22
1543 COMMON /cbess/ j,y,jr,ji,dj,dy,djr,dji
1545 COMMON /ctt/ qr,qi,rgqr,rgqi
1552 IF (ncheck.EQ.1)
THEN
1567 CALL vig (x(i1),nmax,m,dv1,dv2)
1649 c5r=c1r*drri-c1i*drii
1650 c5i=c1i*drri+c1r*drii
1651 b5r=b1r*drri-b1i*drii
1652 b5i=b1i*drri+b1r*drii
1664 c8r=c2r*drri-c2i*drii
1665 c8i=c2i*drri+c2r*drii
1666 b8r=b2r*drri-b2i*drii
1667 b8i=b2i*drri+b2r*drii
1674 IF (ncheck.EQ.1.AND.si.GT.0d0)
GO TO 150
1681 IF (ncheck.EQ.1)
GO TO 160
1685 ar12=ar12+
f1*b2r+
f2*b3r
1686 ai12=ai12+
f1*b2i+
f2*b3i
1687 gr12=gr12+
f1*c2r+
f2*c3r
1688 gi12=gi12+
f1*c2i+
f2*c3i
1691 ar21=ar21+
f1*b4r+
f2*b5r
1692 ai21=ai21+
f1*b4i+
f2*b5i
1693 gr21=gr21+
f1*c4r+
f2*c5r
1694 gi21=gi21+
f1*c4i+
f2*c5i
1695 IF (ncheck.EQ.1)
GO TO 200
1700 ar22=ar22+e1*b6r+e2*b7r+e3*b8r
1701 ai22=ai22+e1*b6i+e2*b7i+e3*b8i
1702 gr22=gr22+e1*c6r+e2*c7r+e3*c8r
1703 gi22=gi22+e1*c6i+e2*c7i+e3*c8i
1705 an12=ann(n1,n2)*factor
1706 r11(n1,n2)=ar11*an12
1707 r12(n1,n2)=ar12*an12
1708 r21(n1,n2)=ar21*an12
1709 r22(n1,n2)=ar22*an12
1710 i11(n1,n2)=ai11*an12
1711 i12(n1,n2)=ai12*an12
1712 i21(n1,n2)=ai21*an12
1713 i22(n1,n2)=ai22*an12
1714 rg11(n1,n2)=gr11*an12
1715 rg12(n1,n2)=gr12*an12
1716 rg21(n1,n2)=gr21*an12
1717 rg22(n1,n2)=gr22*an12
1718 ig11(n1,n2)=gi11*an12
1719 ig12(n1,n2)=gi12*an12
1720 ig21(n1,n2)=gi21*an12
1721 ig22(n1,n2)=gi22*an12
1755 tqr(k1,k2)=tpir*tar21-tpii*tai21+tppi*tar12
1756 tqi(k1,k2)=tpir*tai21+tpii*tar21+tppi*tai12
1757 trgqr(k1,k2)=tpir*tgr21-tpii*tgi21+tppi*tgr12
1758 trgqi(k1,k2)=tpir*tgi21+tpii*tgr21+tppi*tgi12
1760 tqr(k1,kk2)=tpir*tar11-tpii*tai11+tppi*tar22
1761 tqi(k1,kk2)=tpir*tai11+tpii*tar11+tppi*tai22
1762 trgqr(k1,kk2)=tpir*tgr11-tpii*tgi11+tppi*tgr22
1763 trgqi(k1,kk2)=tpir*tgi11+tpii*tgr11+tppi*tgi22
1765 tqr(kk1,k2)=tpir*tar22-tpii*tai22+tppi*tar11
1766 tqi(kk1,k2)=tpir*tai22+tpii*tar22+tppi*tai11
1767 trgqr(kk1,k2)=tpir*tgr22-tpii*tgi22+tppi*tgr11
1768 trgqi(kk1,k2)=tpir*tgi22+tpii*tgr22+tppi*tgi11
1770 tqr(kk1,kk2)=tpir*tar12-tpii*tai12+tppi*tar21
1771 tqi(kk1,kk2)=tpir*tai12+tpii*tar12+tppi*tai21
1772 trgqr(kk1,kk2)=tpir*tgr12-tpii*tgi12+tppi*tgr21
1773 trgqi(kk1,kk2)=tpir*tgi12+tpii*tgr12+tppi*tgi21
1779 qr(n1,n2)=tqr(n1,n2)
1780 qi(n1,n2)=tqi(n1,n2)
1781 rgqr(n1,n2)=trgqr(n1,n2)
1782 rgqi(n1,n2)=trgqi(n1,n2)
1792 SUBROUTINE vig (X, NMAX, M, DV1, DV2)
1793 include
'ampld.par.f'
1794 IMPLICIT REAL*8 (a-h,o-z)
1795 real*8 dv1(npn1),dv2(npn1)
1804 IF (m.NE.0)
GO TO 20
1811 d3=(qn2*x*d2-qn*d1)/qn1
1812 der=qs1*(qn1*qn/qn2)*(-d1+d3)
1822 a=a*dsqrt(dfloat(i2-1)/dfloat(i2))*qs
1830 qnm=dsqrt(qn*qn-qmm)
1831 qnm1=dsqrt(qn1*qn1-qmm)
1832 d3=(qn2*x*d2-qnm*d1)/qnm1
1833 der=qs1*(-qn1*qnm*d1+qn*qnm1*d3)/qn2
1851 SUBROUTINE tt(NMAX,NCHECK)
1852 include
'ampld.par.f'
1853 IMPLICIT REAL*8 (a-h,o-z)
1854 real*8
f(npn2,npn2),b(npn2),work(npn2),
1855 * qr(npn2,npn2),qi(npn2,npn2),
1856 * rgqr(npn2,npn2),rgqi(npn2,npn2),
1857 * a(npn2,npn2),c(npn2,npn2),d(npn2,npn2),e(npn2,npn2)
1858 real*8 tr1(npn2,npn2),ti1(npn2,npn2)
1859 COMPLEX*16 ZQ(NPN2,NPN2),ZW(NPN2)
1860 INTEGER IPIV(NPN2),IPVT(NPN2)
1862 COMMON /ctt/ qr,qi,rgqr,rgqi
1870 zq(i,j)=dcmplx(qr(i,j),qi(i,j))
1874 CALL zgetrf(nnmax,nnmax,zq,npn2,ipiv,info)
1876 CALL zgetri(nnmax,zq,npn2,ipiv,zw,npn2,info)
1901 SUBROUTINE sarea (D,RAT)
1902 IMPLICIT REAL*8 (a-h,o-z)
1903 IF (d.GE.1)
GO TO 10
1905 r=0.5d0*(d**(2d0/3d0) + d**(-1d0/3d0)*dasin(e)/e)
1909 10 e=dsqrt(1d0-1d0/(d*d))
1910 r=0.25d0*(2d0*d**(2d0/3d0) + d**(-4d0/3d0)*dlog((1d0+e)/(1d0-e))
1919 SUBROUTINE surfch (N,E,RAT)
1920 IMPLICIT REAL*8 (a-h,o-z)
1926 CALL gauss (ng,0,0,x,w)
1939 s=s+w(i)*a*dsqrt(a2+ens*ens)
1940 v=v+w(i)*(ds*a+xi*ens)*ds*a2
1943 rv=(v*3d0/4d0)**(1d0/3d0)
1950 SUBROUTINE sareac (EPS,RAT)
1951 IMPLICIT REAL*8 (a-h,o-z)
1952 rat=(1.5d0/eps)**(1d0/3d0)
1953 rat=rat/dsqrt( (eps+2d0)/(2d0*eps) )
1959 SUBROUTINE drop (RAT)
1961 IMPLICIT REAL*8 (a-h,o-z)
1962 real*8 x(ng),w(ng),c(0:nc)
1963 COMMON /cdrop/ c,r0v
1975 CALL gauss (ng,0,0,x,w)
1985 ri=ri+c(n)*dcos(xin)
1986 dri=dri-c(n)*n*dsin(xin)
1991 s=s+wi*ri*dsqrt(ri*ri+dri*dri)
1992 v=v+wi*ri*risi*(risi-dri*ci)
1995 rv=(v*3d0*0.25d0)**(1d0/3d0)
1996 IF (dabs(rat-1d0).GT.1d-8) rat=rv/rs
2016 SUBROUTINE gauss (N,IND1,IND2,Z,W)
2017 IMPLICIT REAL*8 (a-h,p-z)
2027 IF(i.EQ.1) x=a-b/((
f+a)*
f)
2028 IF(i.EQ.2) x=(z(n)-a)*4d0+z(n)
2029 IF(i.EQ.3) x=(z(n-1)-z(n))*1.6d0+z(n-1)
2030 IF(i.GT.3) x=(z(m+1)-z(m+2))*c+z(m+3)
2031 IF(i.EQ.k.AND.ind.EQ.1) x=0d0
2036 IF (niter.LE.100)
GO TO 15
2044 20 pc=x*pb+(x*pb-pa)*(dj-a)/dj
2048 IF(dabs(pb).GT.check*dabs(x))
GO TO 10
2051 IF(ind1.EQ.0) w(m)=b*w(m)
2052 IF(i.EQ.k.AND.ind.EQ.1)
GO TO 100