主题:module问题
贝贝daisy
[专家分:0] 发布于 2010-12-12 21:22:00
在module中对一些变量进行封装,但是
在subroutine input
use global
再读入文件的形式将module中的变量进行赋初值,可惜总是出现
1.obj - 0 error(s), 14 warning(s)
错误为:: Warning: Variable NSJ is used before its value has been defined
3 楼
贝贝daisy [专家分:0] 发布于 2010-12-13 14:28:00
module global
integer bj(5000,2),bbj(5000),back(5000,3),nbline(5000),nm(5000),jdbh(5000,3)
integer c,cc,maxpoint,ff,t,tt,v,yzd,a,aa,b,d,f,h,j,s,ss,pp,qq,jm,jj,k,cssj
integer add,g,gg,x11,y11,x21,y21,x31,y31,id(3)
real*8 p(5000,2),rr(5000),r(5000),m(5000,3),e,bb(5000),yzx,yxy,l1(5000),l2(5000),l(5000)
real*8 x1,y1, x2,y2,x3,y3,z11,z12,z112,z21,z22,z222,z31,z32,z332,x0,y0,x12,y12,x22,y22,yline
real*8 newp,naa,nbb,ncc,xzx,xx,yy,rb(5000),yxj(5000)
logical lg,Lj1,Lj2,Lj3,Li1,Li2,Li3
end module
subroutine input
use global
write(*,*)'how many points to insert?'
read(*,*) maxpoint
open(1,file='input.txt')
read(1,*) np
do i=1,np
read(1,*) p(i,1),p(i,2)
bj(i,1)=p(i,1)
bj(i,2)=p(i,2)
enddo
continue
read(1,*) n
do i=1,n
read(1,*) nbline(i)
enddo
continue
read(1,*)nb
close(1)
end subroutine input
.......
具体的就类似于这个了,麻烦大虾们帮帮忙,出现了
1.obj - 0 error(s), 14 warning(s)
其中某个warning为:
Warning: Variable NP is used before its value has been defined
jdbh(1,1)=np-3
Warning: Variable N is used before its value has been defined
do cc=1,n