| 查看: 187 | 回复: 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 ] |
» 猜你喜欢
有没有人能给点建议
已经有5人回复
假如你的研究生提出不合理要求
已经有12人回复
实验室接单子
已经有7人回复
全日制(定向)博士
已经有5人回复
萌生出自己或许不适合搞科研的想法,现在跑or等等看?
已经有4人回复
Materials Today Chemistry审稿周期
已经有4人回复
参与限项
已经有3人回复
对氯苯硼酸纯化
已经有3人回复
所感
已经有4人回复
要不要辞职读博?
已经有7人回复
» 抢金币啦!回帖就可以得到:
南京大学能源与资源学院-景旭东教授 (英国皇家工程院院士) 团队博士后招聘
+1/491
限广州,征女友
+2/186
上海科技大学物质科学与技术学院|王平鸾课题组长期招聘(博后/博硕/科研助理)
+1/172
26博士申请-药物化学方向
+1/92
招聘:中国科学院山西煤炭化学研究所
+1/86
原子层沉积(ALD)磁控溅射PECVD等微纳代工服务:18817872921
+1/82
双一流南京医科大学招计算机、AI、统计、生物信息等方向26年9月入学博士
+1/82
北京航空航天大学教授课题组招生启事
+1/80
中国石油大学(华东)电气工程专业博士研究生招生
+1/77
浙江师范大学国家杰青杨启华教授团队招收2026年博士研究生
+1/68
留学导师避雷——望传播
+1/58
北京-89175-事业单位-诚征女友
+1/58
北京—征老婆
+1/50
昆士兰科技大学(QUT)博士招生信息 导师:李志勇教授
+1/35
北京林业大学林学院——昆虫病毒/病毒组——博士招生
+1/28
南京邮电大学-材料院尹超教授课题组-诚聘材料、化学、生物医学博士后(长期有效)
+1/13
骨生物材料与侗药调控类器官再生湖南省普通高等学校重点实验室主任团队招聘了
+5/10
哈工大深圳招收26年3月份博士/博后
+1/3
【招聘】西北农林科技大学罗自卫组招聘合成生物学与代谢工程研究方向青年教师/博士后
+1/1
天津理工大学0854、控制、信息与通信工程调剂交流
+1/1












回复此楼