| 查看: 214 | 回复: 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 ] |
» 猜你喜欢
301求调剂
已经有18人回复
化工学硕 285求调剂
已经有19人回复
328求调剂
已经有8人回复
求调剂
已经有28人回复
304求调剂(085602,过四级,一志愿985)
已经有21人回复
288环境专硕,求调材料方向
已经有33人回复
285求调剂
已经有16人回复
273求调剂
已经有41人回复
331求调剂
已经有4人回复
298求调剂
已经有4人回复
» 抢金币啦!回帖就可以得到:
河北大学分析化学招收多名调剂考生
+5/619
四川轻化工大学物理与电子工程学院 2026年硕士研究生调剂公告
+2/114
西安石油大学新能源学院接收材料类、能源动力类、机械类、计算机类等专业专硕调剂生!
+1/91
欢迎调剂北京石油化工学院聚合物功能材料组
+1/83
百年学府,福建师范大学化学材料类研究生调剂
+1/45
常州大学-环境科学与工程学院招收环境工程学硕和专硕调剂-网络复试-多学科
+1/38
中国科学院深圳先进院唐永炳研究员团队诚聘电化学/电池方向博士后
+1/35
河南工业大学化学化工学院 2026 年硕士调剂正在进行!
+1/32
汕头大研究生调剂招生
+1/31
湖南工业大学智能传感与脑机接口课题组招收生物医学工程博士研究生1名
+1/19
长沙理工大学土木水利招收专硕调剂生
+1/14
大连大学 化学专业 招收26年硕士研究生调剂
+1/11
河北大学招收生物与医药专业调剂考生
+1/9
福建师范大学 2026硕士调剂 (化学、光电器件、物理、纳米材料方向)
+1/8
082200,085606,085606
+1/8
烟台大学化学化工学院班庆福课题组招收调剂生
+1/5
上海交通大学化学化工学院张智涛课题组诚聘博士后
+1/4
复试调剂
+1/3
南华大学杨晴来课题组2026年接受考研调剂
+3/3
军事医学研究员毒物药物研究所药理学生物技术药物代谢方向招收调剂生 4名
+1/2














回复此楼