马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
大家好!在下是fortran语言的初学者,编写了一个有限元的程序,在执行compile时没有错误,但执行execute时显示两个错误,恳请各位前辈赐教!万分感谢!
显示的错误:--------------------Configuration: ll - Win32 Debug--------------------
Linking...
ll.obj : error LNK2001: unresolved external symbol _FJ@4
Debug/ll.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
ll.exe - 2 error(s), 0 warning(s)
原程序:
program main
common xy(200,2)
common/C/ie(200,3),ek(6,6),D(3,3),S(3,6)
common/C1/jf(20),fi(20),ib(80)
common/C2/zz(500,20),p(500)
external in
call in(nc,ne,np,nb,nd,nj2,e0,pu,te)
call md(e0,pu)
call cma(in,te)
call mzz(in,nj2,nd,ne,te)
call mf(np,nj2)
call mb(nb,nd)
call gau(nc,nj2,nd)
call sg(ne,te)
stop
end
subroutine in(nc,ne,np,nb,nd,nj2,e0,pu,te)
common xy(200,2)
common/C/ie(200,3),ek(6,6),D(3,3),S(3,6)
common/C1/jf(20),fi(20),ib(80)
common/C2/zz(500,20),p(500)
open(1,file='in')
read(1,*)nc,ne,np,nb,nd
read(3,*)e0,pu,te
read(3,*)((xy(i,j),j=1,2),i=1,nc)
read(3,*)((ie(i,j),j=1,3),i=1,ne)
read(3,*)(jf(i),i=1,np)
read(3,*)(fi(i),i=1,np)
read(3,*)(ib(i),i=1,nb)
nj2=nc+nc
open(4,file='out',status='new')
write(4,*)nc,ne,np,nb,nd
return
end
subroutine md(e0,pu)
common/C/ie(200,3),ek(6,6),D(3,3),S(3,6)
d(1,1)=e0/(1.-pu*pu)
d(1,2)=e0*pu/(1.-pu*pu)
d(2,1)=d(1,2)
d(2,2)=d(1,1)
d(1,3)=0.
d(3,1)=0.
d(2,3)=0.
d(3,2)=0.
d(3,3)=e0/(1.+pu)/2.
return
end
subroutine cma(in,te)
common xy(200,2)/C/ie(200,3),ek(6,6),D(3,3),S(3,6)
dimension b(3,6)
im=ie(in,1)
je=ie(in,2)
me=ie(in,3)
cm=xy(je,1)-xy(im,1)
bm=xy(im,2)-xy(je,2)
cj=xy(im,1)-xy(me,1)
bj=xy(me,2)-xy(im,2)
ae=(bj*cm-bm*cj)/2
do 10 i=1,3
do 10 j=1,6
b(i,j)=0.
s(i,j)=0.
10 continue
b(1,1)=-bj-bm
b(1,3)=bj
b(1,5)=bm
b(2,2)=-cj-cm
b(2,4)=cj
b(2,6)=cm
b(3,1)=b(2,2)
b(3,2)=b(1,1)
b(3,3)=b(2,4)
b(3,4)=b(1,3)
b(3,5)=b(2,6)
b(3,6)=b(1,5)
do 20 i=1,3
do 20 j=1,6
b(i,j)=b(i,j)/ae/2
20 continue
do 30 i=1,3
do 30 j=1,6
do 30 k=1,3
s(i,j)=s(i,j)+d(i,k)*b(k,j)
30 continue
do 40 i=1,6
do 40 j=1,6
ek(i,j)=0.
do 40 k=1,3
ek(i,j)=ek(i,j)+s(k,i)*b(k,j)*ae*te
40 continue
return
end
subroutine mzz(in,nj2,nd,ne,te)
common xy(200,2)
common/C/ie(200,3),ek(6,6),D(3,3),S(3,6)
1 common/C2/zz(500,20),p(500)
do 10i=1,nj2
do 10j=1,nd
10 zz(i,j)=0.
do 20 in=1,ne
call cma(in,te)
do 20i=1,3
do 20ii=1,2
ih=2*(i-1)+ii
jh=2*(ie(in,i)-1)+ii
do 20j=1,3
do 20jj=1,2
il=2*(j-1)+jj
iz=2*(ie(in,j)-1)+jj
jl=iz-jh+1
if(jl.gt.0)zz(jh,jl)=zz(jh,jl)+ek(ih,il)
20 continue
return
end
subroutine mf(np,nj2)
common/C1/jf(20),fi(20),ib(80)/C2/zz(500,20),p(500)
do 10i=1,nj2
10 p(i)=0.
if(np.gt.0)then
do 20i=1,np
j=jf(i)
20 p(j)=fj(i)
end if
return
end
subroutine mb(nb,nd)
common/C1/jf(20),fi(20),ib(80)/C2/zz(500,20),p(500)
do 30i=1,nb
iz=ib(i)
zz(iz,1)=1.
do 10j=2,nd
10 zz(iz,j)=0.
if(iz.gt.nd)then
jo=nd
else
jo=iz
end if
do 20j=2,jo
20 zz(iz-j+1,j)=0.
p(iz)=0.
30 continue
return
end
subroutine gau(nc,nj2,nd)
common/C2/zz(500,20),p(500)
do 20 i=1,nj2-1
if(nj2.gt.i+nd-1)then
im=i+nd-1
else
im=nj2
end if
do 20k=i+1,im
il=k-i+1
c=zz(i,il)/zz(i,1)
do 10j=1,nd-il+1
m=j+k-i
10 zz(k,j)=zz(k,j)-c*zz(i,m)
p(k)=p(k)-c*p(i)
20 continue
p(nj2)=p(nj2)/zz(nj2,1)
do 40j=nj2-1,1,-1
if(nd.gt.nj2-j+1)then
jm=nj2-j+1
else
jm=nd
end if
do 30i=2,jm
ih=i+j-1
30 p(j)=p(j)-zz(j,i)*p(ih)
40 p(j)=p(j)/zz(j,1)
write(4,101)
101 format(3X,3hjd=,5X,2hu=,16X,2hv=)
do 50i=1,nc
write(4,102)i,p(i+i-1),p(i+i)
102 format(3x,I5,3X,f15.10,3X,f15.10)
50 continue
return
end
subroutine sg(ne,te)
common/C/ie(200,3),ek(6,6),D(3,3),S(3,6)/C2/zz(500,20),p(500)
dimension wy(6),yl(6)
do 30 in=1,ne
call cma(in,te)
do 10 i=1,3
do 10 j=1,2
ih=2*(i-1)+j
jh=2*(ie(in,i)-1)+j
10 wy(ih)=p(jh)
do 20 i=1,3
yl(i)=0.
do 20 j=1,6
20 yl(i)=yl(i)+s(i,j)*wy(j)
s1=yl(1)
s2=yl(2)
s3=yl(3)
py=(s1+s2)/2.
ry=sqrt(((s1-s2)/2.)**2+s3**2)
sa=py+ry
si=py-ry
if(abs(s2-si).lt..001)then
set=0.
else
set=90.-57.29578*atan(s3/(s2-si))
end if
write(4,'(5X,"in=",i5)')in
write(4,'(2x,"sigmax=",f14.7,2x,"sigmay=",f14.7,2x,"tau=",f14.7)')
& s1,s2,s3
write(4,'(2x,"sigma1=",f14.7,2x,"sigma2=",f14.7,2x,"cet=",f14.7)')
& sa,si,set
30 continue
return
end |