|
沙发
楼主 |
发表于 2018-11-14 15:39:24
|
只看该作者
C**************************************************************
SUBROUTINE MULTI(N,LMIN,LMAX,MK,X0,XE,H00)
DIMENSION X(100),Y(100),H(5000),RO(5000),R0(5000),
& EPS(5000),P(5000),F(5000),R(5000),G(20)
COMMON /COMK/KL
DATA NMAX,G0/100,2.0943951/
NN=(N+1)/2
KL=LMIN
CALL KNDX(KL,N,NS,NMAX,DX,X0,XE,X,Y)
CALL INITI(N,X,Y,P(NS))
12 CALL HREE(N,DX,H00,G0,X,Y,H,RO,EPS,P(NS),F(NS),0)
14 DO 100 L=LMIN,LMAX
KL=L
G(KL)=G0
20 KK=2
CALL ITER(N,KK,DX,H00,G0,X,Y,H,RO,EPS,P(NS),F(NS),R(NS),0)
KK=1
CALL CHAN(N,R0,R(NS))
CALL ITER(N,KK,DX,H00,G0,X,Y,H,RO,EPS,P(NS),F(NS),R0,1)
CALL GCAL(N,G1,P(NS))
G(KL-1)=G(KL)-DX*DX*G1
N2=N
NS0=NS
KL=KL-1
CALL KNDX(KL,N,NS,NMAX,DX,X0,XE,X,Y)
CALL TRANS(N,N2,N2*N2,H,RO,EPS,P(NS),P(NS0),R(NS),R0)
CALL ITER(N,KK,DX,H00,G0,X,Y,H,RO,EPS,P(NS),F(NS),R(NS),2)
CALL GCAL(N,G1,P(NS))
G(KL)=G(KL)+DX*DX*G1
G0=G(KL)
CALL HREE(N,DX,H00,G0,X,Y,H,RO,EPS,P(NS),F(NS),1)
IF(KL.NE.1)GOTO 20
KK=15
CALL ITER(N,KK,DX,H00,G0,X,Y,H,RO,EPS,P(NS),F(NS),R(NS),0)
40 NS0=NS
KL=KL+1
N1=N
CALL KNDX(KL,N,NS,NMAX,DX,X0,XE,X,Y)
G0=G(KL)
CALL TRAP(N1,N,P(NS0),P(NS))
CALL HREE(N,DX,H00,G0,X,Y,H,RO,EPS,P(NS),F(NS),0)
KK=1
CALL ITER(N,KK,DX,H00,G0,X,Y,H,RO,EPS,P(NS),F(NS),R(NS),0)
IF(KL.LT.L)GOTO 40
CALL CHAN(N,R0,R(NS))
CALL ITER(N,KK,DX,H00,G0,X,Y,H,RO,EPS,P(NS),F(NS),R0,1)
100 CONTINUE
M=M+1
IF(M.LT.MK)GOTO 14
120 CALL OUPT(N,X,Y,H,P(NS))
RETURN
END
C**************************************************************
SUBROUTINE OUPT(N,X,Y,H,P)
DIMENSION X(N),Y(N),H(N,N),P(N,N)
NN=(N+1)/2
A=0.0
WRITE(8,*)N,NN
WRITE(8,110)A,(Y(I),I=1,N)
DO I=1,N
WRITE(8,110)X(I),(H(I,J),J=1,N)
END DO
WRITE(10,*)N,NN
WRITE(10,110)A,(Y(I),I=1,N)
DO I=1,N
WRITE(10,110)X(I),(P(I,J),J=1,N)
END DO
110 FORMAT(34(1X,E12.6))
RETURN
END
C**************************************************************
SUBROUTINE TRAP(N1,N2,P1,P2)
DIMENSION P1(N1,N1),P2(N2,N2)
DO 10 I=1,N1-1
II=2*I
DO 10 J=1,N1-1
JJ=2*J
10 P2(II,JJ)=P2(II,JJ)+0.25*(P1(I,J)+P1(I+1,J)+
& P1(I+1,J+1)+P1(I,J+1)-P2(II-1,JJ-1)-P2(II-1,JJ+1)-
& P2(II+1,JJ+1)-P2(II+1,JJ-1))
DO 20 I=1,N1-1
II=2*I
DO 20 J=1,N1
JJ=2*J-1
P2(II,JJ)=P2(II,JJ)+0.5*(P1(I,J)+P1(I+1,J)-
& P2(II-1,JJ)-P2(II+1,JJ))
20 P2(JJ,II)=P2(JJ,II)+0.5*(P1(J,I)+P1(J,I+1)-
& P2(JJ,II-1)-P2(JJ,II+1))
DO 30 I=1,N1
II=2*I-1
DO 30 J=1,N1
JJ=2*J-1
30 P2(II,JJ)=P1(I,J)
RETURN
END
C**************************************************************
SUBROUTINE INITI(N,X,Y,P)
DIMENSION X(N),Y(N),P(N,N)
NN=(N+1)/2
DO 10 I=1,N
D=1.-X(I)*X(I)
DO 10 J=1,NN
C=D-Y(J)*Y(J)
IF(C.LE.0.0)P(I,J)=0.0
10 IF(C.GT.0.0)P(I,J)=SQRT(C)
DO 20 I=1,N
DO 20 J=NN+1,N
JJ=N-J+1
20 P(I,J)=P(I,JJ)
RETURN
END
C**************************************************************
SUBROUTINE CHAN(N,R1,R2)
DIMENSION R1(N,N),R2(N,N)
DO 10 I=1,N
DO 10 J=1,N
10 R1(I,J)=R2(I,J)
RETURN
END
C**************************************************************
SUBROUTINE GCAL(N,G,P)
DIMENSION P(N,N)
G=0.
DO 10 I=1,N
DO 10 J=1,N
10 G=G+P(I,J)
RETURN
END
C**************************************************************
SUBROUTINE KNDX(K,N,NS,NMAX,DX,X0,XE,X,Y)
DIMENSION INDEX(6),NNDEX(6),X(NMAX),Y(NMAX)
DATA INDEX,NNDEX/1,82,371,1460,5685,16616,
& 9,17,33,65,129,257/
N=NNDEX(K)
NS=INDEX(K)
DX=(XE-X0)/(N-1.)
Y0=-0.5*(XE-X0)
DO 10 I=1,N
X(I)=X0+(I-1)*DX
10 Y(I)=Y0+(I-1)*DX
RETURN
END
C**************************************************************
SUBROUTINE HREE(N,DX,H00,G0,X,Y,H,RO,EPS,P,F,KG)
DIMENSION X(N),Y(N),P(N,N),H(N,N),RO(N,N),EPS(N,N),F(N,N)
DIMENSION W(150,150),P0(150,150)
COMMON /COM1/ENDA,A1,A2,A3,Z,C1,C2,HM0/COMK/KL
& /COMAK/AK(0:100,0:100)
DATA KK,NW,PAI1/0,150,0.2026423/
NN=(N+1)/2
CALL VI(N,DX,P,W,NW)
HMIN=1.E3
DO 30 I=1,N
W1=0.5*X(I)*X(I)
DO 30 J=1,NN
H0=W1+0.5*Y(J)*Y(J)+W(I,J)
IF(KG.EQ.1)GOTO 20
IF(H0+F(I,J).LT.HMIN)HMIN=H0+F(I,J)
H(I,J)=H0
GOTO 30
20 F(I,J)=H(I,J)-H00-H0
F(I,N-J+1)=F(I,J)
30 CONTINUE
IF(KK.EQ.0)H00=HM0-HMIN
KK=1
IF(KG.EQ.1)RETURN
H0=H00+HMIN
IF(H0.LE.0.0)GOTO 40
IF(KL.NE.1)GOTO 50
W1=0.0
DO 32 I=1,N
DO 32 J=1,N
32 W1=W1+P(I,J)
W1=DX*DX*W1/G0
DW=1.-W1
HM0=H0*W1
40 H00=-HMIN+HM0
50 DO 60 I=1,N
DO 60 J=1,NN
IF(P(I,J).LT.0.0)P(I,J)=0.0
EDA=EXP(A1*(-1.+(1.+A2*P(I,J))**Z))
H(I,J)=H00+H(I,J)+F(I,J)
RO(I,J)=(A3+1.34*P(I,J))/(A3+P(I,J))
60 EPS(I,J)=RO(I,J)*H(I,J)**3/(ENDA*EDA)
DO 70 J=NN+1,N
JJ=N-J+1
DO 70 I=1,N
H(I,J)=H(I,JJ)
RO(I,J)=RO(I,JJ)
70 EPS(I,J)=EPS(I,JJ)
RETURN
END
C**************************************************************
SUBROUTINE ITER(N,KK,DX,H00,G0,X,Y,H,RO,EPS,P,F,R,KG)
DIMENSION X(N),Y(N),P(N,N),H(N,N),RO(N,N),
& EPS(N,N),F(N,N),R(N,N)
DIMENSION D(200),A(1000),B(600),ID(200)
COMMON /COM1/ENDA,A1,A2,A3,Z,C1,C2,C3
& /COMAK/AK(0:100,0:100)
DATA KG1,PAI1/0,0.2026423/
IF(KG1.NE.0)GOTO 2
KG1=1
AK00=AK(0,0)
AK10=AK(1,0)
AK20=AK(2,0)
BK00=AK00-AK10
BK10=AK10-0.25*(AK00+2.*AK(1,1)+AK(2,0))
BK20=AK20-0.25*(AK10+2.*AK(2,1)+AK(3,0))
2 NN=(N+1)/2
MM=N-1
DX1=1./DX
DX2=DX*DX
DX3=1./DX2
DX4=0.3*DX2
DO 100 K=1,KK
DO 70 J=2,NN
J0=J-1
J1=J+1
JJ=N-J+1
IF(KG.NE.0)GOTO 20
IA=1
8 MM=N-IA
IF(P(MM,J0).GT.1.E-6)GOTO 20
IF(P(MM,J).GT.1.E-6)GOTO 20
IF(P(MM,J1).GT.1.E-6)GOTO 20
IA=IA+1
IF(IA.LT.N)GOTO 8
GOT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