| 查看: 196 | 回复: 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 ] |
» 猜你喜欢
酰胺脱乙酰基
已经有9人回复
有时候真觉得大城市人没有县城人甚至个体户幸福
已经有3人回复
CSC & MSCA 博洛尼亚大学能源材料课题组博士/博士后招生|MSCA经费充足、排名优
已经有5人回复
有70后还继续奋斗在职场上的吗?
已经有6人回复
博士延得我,科研能力直往上蹿
已经有7人回复
退学或坚持读
已经有27人回复
面上基金申报没有其他的参与者成吗
已经有5人回复
遇见不省心的家人很难过
已经有22人回复
» 抢金币啦!回帖就可以得到:
西南科技大学曹克课题组招收2026级申请考核制有机化学博士研究生
+1/188
多功能 电子微生物生长分析仪 及 微生物快检技术开发服务
+2/140
香港科技大学(广州)黄加强课题组智能电池方向博士招聘
+1/88
天津科技大学邓启良教授团队 招收2026年博士生
+1/80
博后平台选择
+1/62
香港科技大学计算物理及流体力学课题组招收全奖博士后及博士生(2026年9月入学)
+1/38
南方科技大学物理系夏秀杨课题组招收博士生/博士后 计算与理论软物质/生物物理方向
+1/35
山东科技大学招聘化学化工博士博士后
+1/26
江西理工大学 稀土学院 稀土功能材料方向 招收2026届博士研究生、硕士研究生
+1/26
苏州大学招收申请考核制博士生、博士后(2026)
+1/21
意大利华人老师University of Padova-全额奖学金博士
+1/11
招收中国CSC或学校资助联培博士生/访问学生-- Tsinghua-A*STAR 2025 Joint Funding
+1/10
江汉大学轩亮教授课题组招博士研究生/博士后
+1/8
青岛大学招收少数民族【少干计划】生物与医药博士研究生
+1/7
复旦大学化学系凡勇教授/张凡教授团队招聘博士后
+1/3
邵阳学院食品与化学工程学院硕士调剂
+1/3
德国Karlsruhe Institute of Technology招收电化学储能及联合培养CSC博士等
+1/2
求资源
+1/2
上海理工顾敏院士/李蔚团队招收2026级博士研究生 (集成光学、量子信息方向)
+1/2
武汉工程大学董志兵教授课题组招收博士/硕士研究生(长期有效)
+1/1













回复此楼