主题:common语句的问题
各位大侠好,我的编译的程序出了问题():
--------------------Configuration: TALNLX - Win32 Debug--------------------
Compiling Fortran...
E:\practice2\Hermite\TALNLX.FOR
E:\practice2\Hermite\TALNLX.FOR(29) : Error: A dummy argument name is invalid in this context. [N]
COMMON/NL/N,L,DL
------------------^
E:\practice2\Hermite\TALNLX.FOR(29) : Error: A dummy argument name is invalid in this context. [DL]
COMMON/NL/N,L,DL
----------------------^
Error executing df.exe.
TALNLX.OBJ - 2 error(s), 0 warning(s)
好像是common语句的问题,但我找不到问题到底出在哪里,请各位帮忙好吗,多谢勒。程序如下:
SUBROUTINE SLNN
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
COMMON/LNFJ/SLNI(164),SLNF(164),SLNJ(164)
DO 1 N=2,164
1 SLNI(N)=DLOG(DBLE(FLOAT(N-1)))
SLNI(1)=0.D0
FLN=1.D0
DO 2 N=2,164
FLN=FLN*DBLE(FLOAT(N-1))
2 SLNF(N)=DLOG(FLN)
SLNF(1)=0.0D0
FLN=1.0D0
DO 3 N=1,163,2
FLN=FLN*DBLE(FLOAT(N))
3 SLNJ(N+1)=DLOG(FLN)
FLN=1.0D0
DO 4 N=2,162,2
FLN=FLN*DBLE(FLOAT(N))
4 SLNJ(N+1)=DLOG(FLN)
SLNJ(1)=0.D0
END
*********************************************************
double precision function ALNLX(N,DL,X)
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
COMMON /LNFJ/SLNI(164),SLNF(164),SLNJ(164)
COMMON/NL/N,L,DL
S=0.D0
DO 20 M=0,N
S=S+(-2.D0)**M*M*DEXP(SLNJ(2*N+2*L+2))*X**M*(1/2**N)*
& DEXP(-SLNF(M+1)-SLNF(N-M+1)-SLNJ(2*M+2*L+2))
20 CONTINUE
ALNLX=S
END
*********************************************************
PROGRAM TALNLX
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
COMMON /LNFJ/SLNI(164),SLNF(164),SLNJ(164)
COMMON/NL/N,L,DL
COMMON/AL/ALF,ALF2
PARAMETER(PI=3.1415926)
OPEN(UNIT=2,FILE='TALNLS.DAT',STATUS='UNKNOWN')
CALL SLNN
WRITE(*,*)N,DL
ALF=1.0D0
ALF2=ALF**2
IF(INT(DL)*2.D0+1.NE.DL*2.D0) STOP
L=INT(DL)
GHY=DSQRT(2.D0**(N+L+2)*(ALF**3)*(1/DSQRT(PI)))*
& DEXP(SLNF(N+1)-SLNF(2*N+2*L+2))
DO 30 IR=1,10000
R=0.001D0*IR
A=ALNLX(N,DL,ALF2*R**2)
P=GHY*(ALF*R)**L*DEXP(-0.5*ALF2*R**2)*A
PROB=R*R*P*P
WRITE(*,*)R,PROB
30 CONTINUE
END
--------------------Configuration: TALNLX - Win32 Debug--------------------
Compiling Fortran...
E:\practice2\Hermite\TALNLX.FOR
E:\practice2\Hermite\TALNLX.FOR(29) : Error: A dummy argument name is invalid in this context. [N]
COMMON/NL/N,L,DL
------------------^
E:\practice2\Hermite\TALNLX.FOR(29) : Error: A dummy argument name is invalid in this context. [DL]
COMMON/NL/N,L,DL
----------------------^
Error executing df.exe.
TALNLX.OBJ - 2 error(s), 0 warning(s)
好像是common语句的问题,但我找不到问题到底出在哪里,请各位帮忙好吗,多谢勒。程序如下:
SUBROUTINE SLNN
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
COMMON/LNFJ/SLNI(164),SLNF(164),SLNJ(164)
DO 1 N=2,164
1 SLNI(N)=DLOG(DBLE(FLOAT(N-1)))
SLNI(1)=0.D0
FLN=1.D0
DO 2 N=2,164
FLN=FLN*DBLE(FLOAT(N-1))
2 SLNF(N)=DLOG(FLN)
SLNF(1)=0.0D0
FLN=1.0D0
DO 3 N=1,163,2
FLN=FLN*DBLE(FLOAT(N))
3 SLNJ(N+1)=DLOG(FLN)
FLN=1.0D0
DO 4 N=2,162,2
FLN=FLN*DBLE(FLOAT(N))
4 SLNJ(N+1)=DLOG(FLN)
SLNJ(1)=0.D0
END
*********************************************************
double precision function ALNLX(N,DL,X)
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
COMMON /LNFJ/SLNI(164),SLNF(164),SLNJ(164)
COMMON/NL/N,L,DL
S=0.D0
DO 20 M=0,N
S=S+(-2.D0)**M*M*DEXP(SLNJ(2*N+2*L+2))*X**M*(1/2**N)*
& DEXP(-SLNF(M+1)-SLNF(N-M+1)-SLNJ(2*M+2*L+2))
20 CONTINUE
ALNLX=S
END
*********************************************************
PROGRAM TALNLX
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
COMMON /LNFJ/SLNI(164),SLNF(164),SLNJ(164)
COMMON/NL/N,L,DL
COMMON/AL/ALF,ALF2
PARAMETER(PI=3.1415926)
OPEN(UNIT=2,FILE='TALNLS.DAT',STATUS='UNKNOWN')
CALL SLNN
WRITE(*,*)N,DL
ALF=1.0D0
ALF2=ALF**2
IF(INT(DL)*2.D0+1.NE.DL*2.D0) STOP
L=INT(DL)
GHY=DSQRT(2.D0**(N+L+2)*(ALF**3)*(1/DSQRT(PI)))*
& DEXP(SLNF(N+1)-SLNF(2*N+2*L+2))
DO 30 IR=1,10000
R=0.001D0*IR
A=ALNLX(N,DL,ALF2*R**2)
P=GHY*(ALF*R)**L*DEXP(-0.5*ALF2*R**2)*A
PROB=R*R*P*P
WRITE(*,*)R,PROB
30 CONTINUE
END