版块导航
正在加载中...
客户端APP下载
论文辅导
调剂小程序
登录
注册
帖子
帖子
用户
本版
应《网络安全法》要求,自2017年10月1日起,未进行实名认证将不得使用互联网跟帖服务。为保障您的帐号能够正常使用,请尽快对帐号进行手机号验证,感谢您的理解与支持!
24小时热门版块排行榜
>
论坛更新日志
(6620)
>
导师招生
(1380)
>
考研
(1280)
>
虫友互识
(588)
>
文献求助
(479)
>
休闲灌水
(243)
>
基金申请
(189)
>
考博
(185)
>
招聘信息布告栏
(145)
>
硕博家园
(137)
>
论文投稿
(117)
>
博后之家
(96)
>
绿色求助(高悬赏)
(46)
>
教师之家
(41)
>
SciFinder/Reaxys
(39)
>
找工作
(35)
小木虫论坛-学术科研互动平台
»
计算模拟区
»
程序语言
»
Fortran
»
【求助】FORTRAN编译通过,但是运行不了
5
1/1
返回列表
查看: 2678 | 回复: 19
只看楼主
@他人
存档
新回复提醒
(忽略)
收藏
在APP中查看
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖
zyj8119
木虫
(著名写手)
应助: 65
(初中生)
贵宾: 0.003
金币: 915.1
散金: 1440
红花: 35
帖子: 2936
在线: 1329.4小时
虫号: 664177
注册: 2008-11-29
性别: GG
专业: 理论和计算化学
[交流]
【求助】FORTRAN编译通过,但是运行不了
已有3人参与
CODE:
PROGRAM MAIN
PARAMETER(num=14797,blx=61.634002,bly=62.406401,blz=63.429759,
* namino=200)
CHARACTER name(num)*9,fft(num)*5,atomname(num)*4,fx(num)*4
INTEGER occupation(num),Tatom,itt,i
real xc(num),yc(num),zc(num),charge(num)
real xtemp,ytemp,ztemp,xfinal,yfinal,zfinal
OPEN(10,file='2.car',status='old')
do 20 i=1,num
read(10,*)name(i),xc(i),yc(i),zc(i),fx(i),occupation(i),
* fft(i),atomname(i),charge(num)
20 continue
close(10)
do 30 i=1,num
xc(i)=0
yc(i)=0
zc(i)=0
30 continue
natom_add=0
Tatom=num+natom_add
*********************************************************
* add Si to the chosen Oxygen atom
*********************************************************
do 45 itt=1,namino
xtemp=blx*RAN2(IDUM)
ytemp=bly*RAN2(IDUM)
ztemp=blz*RAN2(IDUM)
lbond=1.90
call addatom(xtemp,ytemp,ztemp,lbond,Tatom,xfinal,yfinal,zfinal)
natom_add=natom_add+1
Tatom=Tatom+natom_add
name(Tatom)='Si'
xc(Tatom)=xfinal
yc(Tatom)=yfinal
zc(Tatom)=zfinal
fx(Tatom)='XXXX'
occupation(Tatom)=1
fft(Tatom)='Si3'
atomname(Tatom)='Si'
charge(Tatom)=5.000
open(140,file='amino.car',access='append')
write(140,888)a(Tatom),xc(Tatom),
& yc(Tatom),zc(Tatom),
& fx(Tatom),occupation(Tatom),
& fft(Tatom),atomname(Tatom),
& charge(Tatom)
close(140)
******************************************************************
* add C1 atom on the chosen Si atom
******************************************************************
lbond=1.93
xtemp=xc(Tatom)
ytemp=yc(Tatom)
ztemp=zc(Tatom)
call addatom(xtemp,ytemp,ztemp,lbond,Tatom,xfinal,yfinal,
* zfinal)
natom_add=natom_add+1
Tatom=Tatom+natom_add
name(Tatom)='C'
xc(Tatom)=xfinal
yc(Tatom)=yfinal
zc(Tatom)=zfinal
fx(Tatom)='XXXX'
occupation(Tatom)=1
fft(Tatom)='C_3'
atomname(Tatom)='C'
charge(Tatom)=6.000
open(150,file='amino.car',access='append')
write(150,888)a(Tatom),xc(Tatom),
& yc(Tatom),zc(Tatom),
& fx(Tatom),occupation(Tatom),
& fft(Tatom),atomname(Tatom),
& charge(Tatom)
close(150)
******************************************************************
* add C2 atom on the chosen C1 atom
******************************************************************
lbond=1.50
xtemp=xc(Tatom)
ytemp=yc(Tatom)
ztemp=zc(Tatom)
call addatom(xtemp,ytemp,ztemp,lbond,Tatom,
& xfinal,yfinal,zfinal)
natom_add=natom_add+1
Tatom=Tatom+natom_add
name(Tatom)='C'
xc(Tatom)=xfinal
yc(Tatom)=yfinal
zc(Tatom)=zfinal
fx(Tatom)='XXXX'
occupation(Tatom)=1
fft(Tatom)='C_3'
atomname(Tatom)='C'
charge(Tatom)=7.000
open(160,file='amino.car',access='append')
write(160,888)a(Tatom),xc(Tatom),
& yc(Tatom),zc(Tatom),
& fx(Tatom),occupation(Tatom),
& fft(Tatom),atomname(Tatom),
& charge(Tatom)
close(160)
******************************************************************
* add C3 atom on the chosen C2 atom
******************************************************************
lbond=1.50
xtemp=xc(Tatom)
ytemp=yc(Tatom)
ztemp=zc(Tatom)
call addatom(xtemp,ytemp,ztemp,lbond,Tatom,
& xfinal,yfinal,zfinal)
natom_add=natom_add+1
Tatom=Tatom+natom_add
name(Tatom)='C'
xc(Tatom)=xfinal
yc(Tatom)=yfinal
zc(Tatom)=zfinal
fx(Tatom)='XXXX'
occupation(Tatom)=1
fft(Tatom)='C_3'
atomname(Tatom)='C'
charge(Tatom)=8.000
open(170,file='amino.car',access='append')
write(170,888)a(Tatom),xc(Tatom),
& yc(Tatom),zc(Tatom),
& fx(Tatom),occupation(Tatom),
& fft(Tatom),atomname(Tatom),
& charge(Tatom)
close(170)
******************************************************************
* add N atom on the chosen C3 atom
******************************************************************
lbond=1.53
xtemp=xc(Tatom)
ytemp=yc(Tatom)
ztemp=zc(Tatom)
call addatom(xtemp,ytemp,ztemp,lbond,Tatom,
& xfinal,yfinal,zfinal)
natom_add=natom_add+1
Tatom=Tatom+natom_add
name(Tatom)='N'
xc(Tatom)=xfinal
yc(Tatom)=yfinal
zc(Tatom)=zfinal
fx(Tatom)='XXXX'
occupation(Tatom)=1
fft(Tatom)='N_3'
atomname(Tatom)='N'
charge(Tatom)=9.000
open(180,file='amino.car',access='append')
write(180,888)a(Tatom),xc(Tatom),
& yc(Tatom),zc(Tatom),
& fx(Tatom),occupation(Tatom),
& fft(Tatom),atomname(Tatom),
& charge(Tatom)
close(180)
45 continue
*********************************************************************************
* write the output file
*********************************************************************************
open(190,file='output-final.car',access='append')
do 200 i=1,Tatom
write(190,888)a(i),xc(i),yc(i),zc(i),fx(i),occupation(i),fft(i),
& atomname(i),charge(i)
200 continue
close(190)
888 format(A5,3X,F12.9,2X,F13.9,3X,F12.9,1X,A4,1X,I1,6X,A5,3X,A2,F7.3)
*********************************************************************************
*********************************************************************************
end
**********************************add atom************************************
SUBROUTINE addatom(xtemp,ytemp,ztemp,lbond,Tatom,xfinal,yfinal,
* zfinal)
REAL center(14,2)
INTEGER Tatom
open(35,file='center.txt',status='old')
do 36 i=1,14
read(35,*)center(i,1),center(i,2)
36 continue
close(35)
lc=1000
xcenter=0
ycenter=0
do 40 j=1,14
lct=sqrt((xtemp-center(i,1))**2+(ytemp-center(i,2)**2))
if(lct.lt.lc)then
lc=lct
*******把整个体分解成无数的平行的平面,确定整个平面的每个分割区域的中心*******************
xcenter=center(i,1)
ycenter=center(i,2)
end if
40 continue
if(ytemp.le.ycenter)then
ja=20
jb=0
jc=-1
jd=j
else
ja=-20
jb=0
jc=1
jd=j
endif
*****************向负方向搜索**********************************
if(xtemp.le.xcenter-5)then
ia=20
ib=0
ic=-1
minlbond=lbond-0.1
maxlbond=lbond+0.1
search_step=0.1
do 1000 i=ia,ib,ic
do 1010 j=ja,jb,jc
do 1020 k=-20,20
targetx=xtemp+search_step*i
targety=ytemp+search_step*j
targetz=ztemp+search_step*k
dis1=sqrt((targetx-xtemp)**2+
& (targety-ytemp)**2+
& (targetz-ztemp)**2)
if(dis1.gt.minlbond.and.dis1.lt.maxlbond)then
do 1030 im=1,Tatom
dis2=sqrt((targetx-xc(im))**2+
& (targety-yc(im))**2+
& (targetz-zc(im))**2)
if(dis2.lt.3.0)then
goto 1020
end if
1030 continue
goto 1040
end if
1020 continue
1010 continue
1000 continue
1040 xfinal=targetx
yfinal=targety
zfinal=targetz
end if
*****************向正方向搜索**********************************
if(xtemp.ge.xcenter+5)then
ia=20
ib=-20
ic=-1
minlbond=lbond-0.1
maxlbond=lbond+0.1
search_step=0.1
do 1050 i=ia,ib,ic
do 1060 j=ja,jb,jc
do 1070 k=-20,20
targetx=xtemp+search_step*i
targety=ytemp+search_step*j
targetz=ztemp+search_step*k
dis1=sqrt((targetx-xtemp)**2+
& (targety-ytemp)**2+
& (targetz-ztemp)**2)
if(dis1.gt.minlbond.and.dis1.lt.maxlbond)then
do 1080 im=1,Tatom
dis2=sqrt((targetx-xc(im))**2+
& (targety-yc(im))**2+
& (targetz-zc(im))**2)
if(dis2.lt.3.0)then
goto 1070
endif
1080 continue
end if
goto 1090
1070 continue
1060 continue
1050 continue
1090 xfinal=targetx
yfinal=targety
zfinal=targetz
end if
end SUBROUTINE
******************************************************************************
FUNCTION RAN2(IDUM)
INTEGER idum,IM1,IM2,IMM1,IA1,IA2,IQ1,IQ2,IR1,IR2,NTAB,NDIV
REAL ran2,AM,EPS,RNMX
PARAMETER (IM1=2147483563,IM2=2147483399,AM=1./IM1,IMM1=IM1-1,
*IA1=40014,IA2=40692,IQ1=53668,IQ2=52774,IR1=12211,IR2=3791,
*NTAB=32,NDIV=1+IMM1/NTAB,EPS=1.2e-7,RNMX=1.-EPS)
INTEGER idum2,j,k,iv(NTAB),iy
SAVE iv,iy,idum2
DATA idum2/123456789/, iv/NTAB*0/, iy/0/
if (idum.le.0) then
idum=max(-idum,1)
idum2=idum
do 11 j=NTAB+8,1,-1
k=idum/IQ1
idum=IA1*(idum-k*IQ1)-k*IR1
if (idum.lt.0) idum=idum+IM1
if (j.le.NTAB) iv(j)=idum
11 continue
iy=iv(1)
endif
k=idum/IQ1
idum=IA1*(idum-k*IQ1)-k*IR1
if (idum.lt.0) idum=idum+IM1
k=idum2/IQ2
idum2=IA2*(idum2-k*IQ2)-k*IR2
if (idum2.lt.0) idum2=idum2+IM2
j=1+iy/NDIV
iy=iv(j)-idum2
iv(j)=idum
if(iy.lt.1)iy=iy+IMM1
ran2=min(AM*iy,RNMX)
return
END
回复此楼
» 猜你喜欢
268求调剂
已经有3人回复
302求调剂
已经有5人回复
311求调剂
已经有10人回复
被我言中:新模板不强调格式了,假专家开始管格式了
已经有4人回复
303求调剂
已经有5人回复
考研求调剂
已经有4人回复
085601专硕,总分342求调剂,地区不限
已经有4人回复
085601材料工程专硕求调剂
已经有5人回复
一志愿天津大学化学工艺专业(081702)315分求调剂
已经有6人回复
能源材料化学课题组招收硕士研究生8-10名
已经有6人回复
高级回复
» 本主题相关价值贴推荐,对您同样有帮助:
【求助】求fortra程序
已经有4人回复
好好学习,天天向上。
1楼
2010-09-08 16:50:11
已阅
回复此楼
关注TA
给TA发消息
送TA红花
TA的回帖
zyj8119
木虫
(著名写手)
应助: 65
(初中生)
贵宾: 0.003
金币: 915.1
散金: 1440
红花: 35
帖子: 2936
在线: 1329.4小时
虫号: 664177
注册: 2008-11-29
性别: GG
专业: 理论和计算化学
引用回帖:
Originally posted by
zyj8119
at 2010-09-08 16:51:55:
center.txt:
2.201 2.228
3.301 3.342
5.502 5.570
7.703 7.798
9.904 10.026
12.105 12.254
14.306 14.482
16.507 16.710
18.708 18.938
20.909 21.166
23.110 23.394
25.311 25.622
27.513 2 ...
http://d.namipan.com/d/e0c22a32e ... 28a70fb9cd4b4831200
,这个是2.car
赞
一下
回复此楼
高级回复
好好学习,天天向上。
4楼
2010-09-08 16:53:18
已阅
回复此楼
关注TA
给TA发消息
送TA红花
TA的回帖
查看全部 20 个回答
zyj8119
木虫
(著名写手)
应助: 65
(初中生)
贵宾: 0.003
金币: 915.1
散金: 1440
红花: 35
帖子: 2936
在线: 1329.4小时
虫号: 664177
注册: 2008-11-29
性别: GG
专业: 理论和计算化学
编译没有错误,但是运行会出现问题:
--------------------Configuration: jiaan - Win32 Debug--------------------
Linking...
jiaan.obj : error LNK2001: unresolved external symbol _A@4
jiaan.obj : error LNK2001: unresolved external symbol _XC@4
jiaan.obj : error LNK2001: unresolved external symbol _YC@4
jiaan.obj : error LNK2001: unresolved external symbol _ZC@4
Debug/jiaan.exe : fatal error LNK1120: 4 unresolved externals
Error executing link.exe.
jiaan.exe - 5 error(s), 0 warning(s)
赞
一下
回复此楼
好好学习,天天向上。
2楼
2010-09-08 16:51:27
已阅
回复此楼
关注TA
给TA发消息
送TA红花
TA的回帖
zyj8119
木虫
(著名写手)
应助: 65
(初中生)
贵宾: 0.003
金币: 915.1
散金: 1440
红花: 35
帖子: 2936
在线: 1329.4小时
虫号: 664177
注册: 2008-11-29
性别: GG
专业: 理论和计算化学
center.txt:
2.201 2.228
3.301 3.342
5.502 5.570
7.703 7.798
9.904 10.026
12.105 12.254
14.306 14.482
16.507 16.710
18.708 18.938
20.909 21.166
23.110 23.394
25.311 25.622
27.513 27.850
29.713 30.078
赞
一下
回复此楼
好好学习,天天向上。
3楼
2010-09-08 16:51:55
已阅
回复此楼
关注TA
给TA发消息
送TA红花
TA的回帖
hakekill
木虫
(小有名气)
应助: 0
(幼儿园)
金币: 1709.3
帖子: 131
在线: 19小时
虫号: 246017
注册: 2006-04-29
性别: GG
专业: 水环境与生态水利
zyj8119(金币+4):但是这四个都是数值啊,那怎么办呢?是数值数组 2010-09-08 17:01:48
错误信息已经很明确的给出了
jiaan.obj : error LNK2001: unresolved external symbol _A@4
jiaan.obj : error LNK2001: unresolved external symbol _XC@4
jiaan.obj : error LNK2001: unresolved external symbol _YC@4
jiaan.obj : error LNK2001: unresolved external symbol _ZC@4
这说明你程序里面使用了A(),XC(),YC(),ZC()这种形式。有可能是你愿意是四个数组,但是没有申明。如果这四个本来就是函数的话,你就要去找找这四个函数是否在你的project里面。
赞
一下
回复此楼
5楼
2010-09-08 16:57:44
已阅
回复此楼
关注TA
给TA发消息
送TA红花
TA的回帖
查看全部 20 个回答
如果回帖内容含有宣传信息,请如实选中。否则帐号将被全论坛禁言
普通表情
龙
兔
虎
猫
高级回复
(可上传附件)
百度网盘
|
360云盘
|
千易网盘
|
华为网盘
在新窗口页面中打开自己喜欢的网盘网站,将文件上传后,然后将下载链接复制到帖子内容中就可以了。
最具人气热帖推荐
[查看全部]
作者
回/看
最后发表
[
考研
]
302求调剂
+5
呼呼呼。。。。
2026-03-17
5/250
2026-03-17 22:54
by
lbsjt
[
基金申请
]
被我言中:新模板不强调格式了,假专家开始管格式了
+4
beefly
2026-03-14
4/200
2026-03-17 22:04
by
黄鸟于飞Chao
[
考研
]
299求调剂
+4
△小透明*
2026-03-17
4/200
2026-03-17 20:09
by
peike
[
考研
]
341求调剂
+5
捣蛋猪猪
2026-03-11
7/350
2026-03-17 19:09
by
捣蛋猪猪
[
考研
]
328求调剂,英语六级551,有科研经历
+3
生物工程调剂
2026-03-16
8/400
2026-03-17 19:03
by
Wangjingyue
[
考研
]
301求调剂
+4
A_JiXing
2026-03-16
4/200
2026-03-17 17:32
by
ruiyingmiao
[
考研
]
0854可跨调剂,一作一项核心论文五项专利,省、国级证书40+数一英一287
+3
小李0854
2026-03-16
3/150
2026-03-17 13:40
by
热情沙漠
[
考研
]
286求调剂
+3
lemonzzn
2026-03-16
5/250
2026-03-16 20:43
by
lemonzzn
[
考研
]
一志愿211 0703方向310分求调剂
+3
努力奋斗112
2026-03-15
3/150
2026-03-16 16:44
by
houyaoxu
[
考研
]
一志愿华中师范071000,325求调剂
+6
RuitingC
2026-03-12
6/300
2026-03-16 14:50
by
可淡不可忘
[
考博
]
东华理工大学化材专业26届硕士博士申请
+6
zlingli
2026-03-13
6/300
2026-03-15 20:00
by
ryzcf
[
考研
]
080500,材料学硕302分求调剂学校
+4
初识可乐
2026-03-14
5/250
2026-03-14 21:08
by
peike
[
考研
]
材料工程327求调剂
+3
xiaohe12w
2026-03-11
3/150
2026-03-14 20:20
by
ms629
[
考研
]
中科大材料专硕319求调剂
+3
孟鑫材料
2026-03-13
3/150
2026-03-14 18:10
by
houyaoxu
[
考研
]
297求调剂
+4
学海漂泊
2026-03-13
4/200
2026-03-14 11:51
by
热情沙漠
[
考研
]
332求调剂
+3
zjy101327
2026-03-11
6/300
2026-03-13 22:48
by
JourneyLucky
[
考研
]
求调剂
+5
一定有学上-
2026-03-12
5/250
2026-03-13 18:31
by
ms629
[
考研
]
工科调剂
+4
Jiang191123!
2026-03-11
4/200
2026-03-13 15:15
by
Miko19
[
考研
]
土木第一志愿276求调剂,科研和技能十分丰富,求新兴方向的导师收留
+3
土木小天才
2026-03-12
3/150
2026-03-13 15:01
by
JourneyLucky
[
考研
]
308求调剂
+3
是Lupa啊
2026-03-12
3/150
2026-03-13 14:30
by
求调剂zz
信息提示
关闭
请填处理意见
关闭
确定