| 查看: 206 | 回复: 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 ] |
» 猜你喜欢
281求调剂(0805)
已经有9人回复
293求调剂
已经有14人回复
0703化学336分求调剂
已经有6人回复
304求调剂
已经有9人回复
环境领域全国重点实验室招收博士1-2名
已经有3人回复
材料专硕306英一数二
已经有10人回复
301求调剂
已经有6人回复
一志愿天津大学化学工艺专业(081702)315分求调剂
已经有7人回复
302求调剂
已经有6人回复
26博士申请
已经有3人回复
» 抢金币啦!回帖就可以得到:
坐标上海,诚征女友,非常 着急,私信必回
+1/470
物理学 调剂
+1/84
物理学 调剂
+1/80
坐标广州,男征女,双向奔赴
+1/67
何时使用 CODA™ 科里奥利质量流量仪表- 艾里卡特(Alicat)
+2/52
天津工业大学航空航天博士招生
+1/35
找工作经验求助
+1/34
中科院生态环境研究中心国重实验室招聘客座研究生1-2名
+1/31
福建师范大学化学与材料学院杜克钊团队博士/硕士招生
+1/14
山东省植物基蛋白技术创新中心课题组联合培养硕士研究生招募启事
+1/12
哈尔滨理工大学材料与化学工程学院 纳米功能材料与光电催化团队 招收硕士研究生
+1/7
中国民航飞行学院先进连接团队招收航空宇航、航空机械专业硕士研究生(学硕专硕均可)
+1/7
福州大学国家级人才汤育欣教授课题组2026年招收”申请考核制“储能电池方向博士研究生
+1/6
上海第二工业大学-朱大海课题组招生(过线就能调剂)
+1/5
静电纺丝:工艺原理、形貌调控与典型应用
+1/4
加拿大阿尔伯塔大学招收电磁、无线通信、机器学习方向全奖硕士/博士/博士后/访问学者
+2/2
125603工业工程与管理调剂
+1/2
323分控制工程求调剂
+1/2
福建师范大学环境微生物技术课题组接受2026级硕士调剂
+1/2
中国科学院地球化学研究所招科研助理
+1/1













回复此楼