计算化学公社

 找回密码 Forget password
 注册 Register

How to fix "Fortran runtime error attempt to deallocate unallocated"

查看数: 8257 | 评论数: 3 | 收藏 Add to favorites 0
关灯 | 提示:支持键盘翻页<-左 右->
    组图打开中,请稍候......
发布时间: 2020-1-3 05:33

正文摘要:

Hello everybody,I need your help about an error message when i run script. I don't know how to fix it. "Fortran runtime error attempt to deallocate unallocated".

回复 Reply

sobereva 发表于 Post on 2020-1-3 22:51:54
Replace line 41 with below content
  1. if (allocated(nat)) deallocate(nat)
  2. if (allocated(atom_name)) deallocate(atom_name)
  3. if (allocated(xat)) deallocate(xat)
  4. if (allocated(yat)) deallocate(yat)
  5. if (allocated(zat)) deallocate(zat)
复制代码
sobereva 发表于 Post on 2020-1-3 10:15:44
That means your code has a bug. The code is employing deallocate( ) routine to deallocate an allocatable array, however it has not been allocated before.
It is best to add a conditional judgment statement before this line as: if (allocated(foo)) ...

手机版 Mobile version|北京科音自然科学研究中心 Beijing Kein Research Center for Natural Sciences|京公网安备 11010502035419号|计算化学公社 — 北京科音旗下高水平计算化学交流论坛 ( 京ICP备14038949号-1 )|网站地图

GMT+8, 2026-2-24 05:50 , Processed in 0.187106 second(s), 25 queries , Gzip On.

快速回复 返回顶部 返回列表 Return to list