| 查看: 230 | 回复: 0 | |||
[交流]
【讨论】麻烦各位高手给看一下我这程序有问题吗?多谢
|
|
麻烦高手帮忙给看一下我这段程序有问题吗?为什么开始几十步的时候,能量基本保持不变,但是后来,动能急剧增加呢,势能也在增加,有劳各位了,多谢了 SUBROUTINE L_J (n,a,ahalf,rcut,position_x,position_y,position_z,u,f_x,f_y,f_z,Ep) IMPLICIT NONE ! the number of particles INTEGER,INTENT(IN)::n ! the potential cutoff REAL,INTENT(IN)::rcut ! the length and half length of box REAL,INTENT(IN)::a,ahalf !potential energy REAL,INTENT(OUT)::Ep ! the position of particles REAL(8),DIMENSION(n),INTENT(INOUT)::position_x,position_y,position_z ! the potential and force of particles REAL,DIMENSION(n),INTENT(OUT)::u,f_x,f_y,f_z ! the contral variable of loop INTEGER::i,j,k ! the label of particles INTEGER::ijk ! the distance of every two particles along the three axis REAL::distance_x,distance_y,distance_z ! the distance's square of every two particles REAL::distance_sq REAL::distance6,distance12,rcut_sq,rcut6,rcut12 REAL::Ec,ff ! initialize the potential and force u=0. Ep=0 f_x=0. f_y=0. f_z=0. ijk=0 !calculate the rcut_sq rcut_sq=rcut*rcut rcut6=rcut_sq**3 rcut12=rcut6*rcut6 Ec=(1./rcut12-1./rcut6) position_i: DO i=1,n-1 distance_ij: DO j=i+1,n distance_x=position_x(i)-position_x(j) distance_y=position_y(i)-position_y(j) distance_z=position_z(i)-position_z(j) !x_distance: distance_x=distance_x-a*REAL(ANINT(distance_x/a)) !y_distance: distance_y=distance_y-a*REAL(ANINT(distance_y/a)) !z_distance: distance_z=distance_z-a*REAL(ANINT(distance_z/a)) ! calculate the distance_sq distance_sq=distance_x**2+distance_y**2+distance_z**2 ! calculate potential and force force:IF (distance_sq distance6=distance_sq**3 distance12=distance6*distance6 ff=(distance_x/distance_sq)*((12./distance12)-(6./distance6)) ! u(ijk)=u(ijk)+(1./distance12-1./distance6)-Ec f_x(i)=f_x(i)+4.*ff f_y(i)=f_y(i)+4.*ff f_z(i)=f_z(i)+4.*ff f_x(j)=f_x(j)-4.*ff f_y(j)=f_y(j)-4.*ff f_z(j)=f_z(j)-4.*ff Ep=Ep+(1./distance12-1./distance6)-Ec END IF force END DO distance_ij ! u(ijk)=4.*u(ijk) END DO position_i Ep=4.*Ep Ep=Ep/real(n) END SUBROUTINE L_J [ Last edited by ghcacj on 2010-12-16 at 13:08 ] |
» 猜你喜欢
评审感受-评审感受-评审感受
已经有6人回复
现在不知道怎么办,感觉很痛苦
已经有5人回复
导师各种操作恶心咋办
已经有9人回复
生物学博士
已经有6人回复
窗边初夏的小雨
已经有8人回复
护理论文 晋升
已经有3人回复
2026年申博-电池方向
已经有11人回复
26年申博自荐-计算机视觉
已经有4人回复
2026博士申请求助
已经有5人回复
研究生做的很差,你们会让毕业吗?
已经有11人回复
» 抢金币啦!回帖就可以得到:
找结婚对象
+1/458
河南师范大学水产学院博士招生
+1/80
华南理工大学微电子学院招电子信息专业博士研究生(2026年秋季入学)
+1/39
谷歌学术引用量增长
+1/37
双一流高校-南京林业大学-化学工程学院-国家海外优青团队招2026级博士(5月15号截止)
+1/36
南昌大学生命科学学院招收博士研究生(中科院联培)
+1/34
中国科学院半导体研究所半导体量子材料与器件课题组多岗位招聘
+1/34
2026年重庆大学药学院有机化学方向博士研究生第三批招生
+1/33
松山湖材料实验室-大连理工大学联合招收2027年博士研究生调剂考生若干名
+1/31
山东中医药大学2026年招聘有机化学、药物化学等相关方向师资博士后
+1/30
香港大学化学系刘俊治课题组招聘博士后
+1/14
。
+1/14
2026年西安交通大学博士招生!
+1/10
中国农业大学资源与环境学院 - 招聘杰出人才、青年研究员、优秀人才和博士后
+1/10
中国科学院深圳先进院成会明院士—王锋项目高级工程师诚聘博士后(医用分离膜方向)
+1/8
天津理工大学国家杰青鲁统部团队第二批博士生招生简章-名额有限
+1/7
【急招】北京航空航天大学 | 超声脑机接口方向 | 2026年博士研究生
+1/3
南京大学医学院附属鼓楼医院院士团队招聘博士后、科研助理
+1/1
科研新人必看:立项/开题/报奖都绕不开科技查新
+1/1
博士后招聘启事|流行病学与AI大健康方向
+1/1












回复此楼