MODULE NEWTON
CONTAINS
SUBROUTINE NEW(Xa,CK,AK)
IMPLICIT REAL*8(A-Z)
INTEGER::I,J,N,k
real*8::X(31)
real*8 XK,XKK
XK=Xa
XKK=Xa
DO K=1,30
FX=XK+AK*XK**(5/3)+XKK-AK*XKK**(5/3)+CK
FXX=1+AK*(5/3)*XK**(5/3-1)
X(K+1)=X(K)-FX/FXX
XK=X(K)
IF (DABS(X(K+1)-X(K))<0.0000001) exit
END DO
END SUBROUTINE NEW
END MODULE NEWTON
USE NEWTON
IMPLICIT REAL*8 (A-Z)
REAL,PARAMETER:: ZETA=0.6
!REAL NNN,SSS,G,DDX,DDT
Integer,PARAMETER::NT=60,NX=10
INTEGER::N,JC=11,K,JK,j
DIMENSION QIN(60),H(61,11),Q(61,11)
REAL*8::DDX=0.4,DDT=5,SSS=0.05,NNN=0.02
OPEN(1,FILE='SHUJU.TXT')
OPEN(2,FILE='JIEGUO.TXT')
READ(1,*) (QIN(I),I=1,60)
ALF=SSS**0.5/NNN
DO JK=1,11
H(1,JK)=0
Q(1,JK)=0
ENDDO
DO N=1,60
H(N,1)=0
ENDDO
DO 99 T=2,60
DO 77 J=2,11
CK=2*ddt/ddx*(1-0.6)*(ALF*H(T-1,J+1)**(5/3)-ALF*H(T-1,J)**(5/3))-H(T-1,J+1)-H(T-1,J)-2*DDT*(QIN(T))
AK=2*DDT*0.6*SSS*0.5/NNN*DDX
Xa=H(T,J-1)
CALL NEW(Xa,CK,AK)
H(T,J)=X(k)
Q(T,J)=ALF*H(T,J)**(5/3)
WRITE(2,1000) ZETA,nnn,sss,DDX,DDT,H(T,J),Q(T,J)
1000 FORMAT(5X,'普列斯曼差分系数ZETA=0.6',F6.2,4X,'曼宁系数nnn=',F6.2,4X,'坡度sss=',f6.2,4X,'重力加速度G=',F6.2,4x,'距离步长DDX=',F6.2,4x,'时间步长DDT=',F6.2,4x,'水位H(I)(m)',F6.2,4x,'流量Q(I)(M3/S)')
77 CONTINUE
99 CONTINUE
END
这个程序在运行时出现两个错误:
Linking...
11.obj : error LNK2001: unresolved external symbol _X@4
Debug/11.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
对程序很弱....希望各位高手指教啊,谢谢....编译器是6.6 用的是fortran95.....
--
FROM 112.25.185.*