|
如题,先贴上主程序的部分代码
[Fortran] 纯文本查看 复制代码
PROGRAM sphere_HS
IMPLICIT NONE
INTEGER NZ,I,K,Dim,NN,J,n,II,JJ,KK,IMAX,lm,T1,T2
PARAMETER (NZ=2000,Dim=62,NN=61,T1=15,T2=30)
real(kind=8) DZ,PI,F,ETA,Y,SADD,SUMP,Rc0,RC,S,z,sum,Fai
real(kind=8) AMU(Dim),FF(Dim,NZ)
real(kind=8) RHO(Dim,2*NZ),RO(Dim,2*NZ)
real(kind=8) RHO1(Dim,2*NZ),RH(Dim,2*NZ)
real(kind=8) SIGMA(DIM),TEMP,RCI,RHOBC,TEN,RD(Dim,2*NZ)
PARAMETER (PI=3.141592654)
real(kind=8) RHOB(Dim),TF,DEFF(Dim),H,Z0,ZH,TEMP0(30000)
real(kind=8) ZZ1,rmax,rr,dr,PHI(DIM,2*NZ)
real(kind=8) ANX1,ANX2,PPP,R,DDE1,DDE2,PT1(NZ),PT2(NZ),PF(NZ)
real(kind=8) AMU1,AMU2,MIUT1,MIUT2,WR,mDirCorFun(dim,dim,2048)
real(kind=8) FDirCorFun(dim,dim,2048),SDirCorFun(dim,dim,2048)
real(kind=8) DirCorFun(dim,dim,2048),cDirCorFun(DIM,DIM,2*NZ)
real(kind=8) Epsi_Thigma(Dim),sigma1(Dim,Dim),rs(Dim,Dim)
real(kind=8) Epsi_Thigma1(Dim,Dim),z1,Uatt(DIm,Dim,2*NZ)
91 FORMAT(1X,2000g15.6)
do i=1,NN
SIGMA(i)=1.0
enddo
sigma(dim)=4.0
F=0.005D0
DZ=0.02D0*SIGMA(1)
ETA=0.35
Fai=0.1
DO I=1,T2
RHOB(I)=0.0001
ENDDO
DO I=T2+1,NN
RHOB(I)=ETA*(1-Fai)*6./PI/sigma(I)**3/DFLOAT(NN-T2)
ENDDO
RHOB(Dim)=ETA*Fai*6./PI/sigma(dim)**3
write(*,*) RHOB
CALL CPS(Dim,SIGMA,RHOB,AMU)
write(*,*) AMU
后面还有很长就不贴了,但是我在这个地方DEBUG就已经出现这个问题了,截图贴给大家看看,右下角窗口的变量DIM没有数值,但是AMU却有值且不为0。
再附上子程序CPS的代码
[Fortran] 纯文本查看 复制代码
SUBROUTINE CPS(M,R,ROU,AMU)
INTEGER M
real(kind=8) R(M),ROU(M),AMU(M),amu1(M)
real(kind=8) ATT(2),PI,PIA,A1,A2,A3,A4
real(kind=8) AKX0,AKX1,AKX2,AKX3,F2,DF3,PHS
real(kind=8) AKX31,AKX31S,AKX31C
PARAMETER (PI=3.141592654)
AKX0=0.0
AKX1=0.0
AKX2=0.0
AKX3=0.0
PIA=PI/6.
DO 10 I=1,M
AKX0=AKX0+ROU(I)
AKX1=AKX1+ROU(I)*R(I)/2 ! R is diameter
AKX2=AKX2+ROU(I)*R(I)*R(I)*PI
AKX3=AKX3+ROU(I)*R(I)**3*PIA
10 CONTINUE
AKX31=1.0-AKX3
AKX31S=AKX31*AKX31
AKX31C=AKX31S*AKX31
PHS=AKX0/AKX31+AKX1*AKX2/AKX31S+(3.-AKX3)*AKX2**3/AKX31C/36./PI
F2=DLOG(AKX31)+AKX3/AKX31-0.5*(AKX3/AKX31)**2
F3=2.*DLOG(AKX31)+AKX3*(1.+AKX31)/AKX31
DO 20 I=1,M
A1=-DLOG(AKX31) + AKX2/AKX31*R(I)/2.
A2=AKX1/AKX31*PI*R(I)**2
& +3*AKX2**2*(DLOG(AKX31)*AKX31S+AKX3)/36./PI/AKX3**2/AKX31S
& *PI*R(I)**2
A3=(AKX0/AKX31+AKX1*AKX2/AKX31S)*R(I)**3*PIA
A4=(-AKX2**3/36./PI/AKX3**2/AKX31
& -2.*AKX2**3/36./PI/AKX3**3*DLOG(AKX31)
& -AKX2**3*(1.-3.*AKX3)/36./PI/AKX31**3/AKX3**2)*R(I)**3*PIA
AMU(I)=A1+A2+A3+A4
20 CONTINUE
RETURN
END
我用的编译器是CVF,不知我的问题描述清楚没,请各位大神多多帮助!! |
|