LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 722|回复: 0

Linux下fortran报错

[复制链接]
发表于 2007-6-2 13:21:47 | 显示全部楼层 |阅读模式
请教各位,有个fortran程序,编译通过了,但是调试的时候出现下面的情况


  1. [hujinhe@console ~]$ gdb ./mdord.exe
  2. GNU gdb Red Hat Linux (6.3.0.0-1.96rh)
  3. Copyright 2004 Free Software Foundation, Inc.
  4. GDB is free software, covered by the GNU General Public License, and you are
  5. welcome to change it and/or distribute copies of it under certain conditions.
  6. Type "show copying" to see the conditions.
  7. There is absolutely no warranty for GDB.  Type "show warranty" for details.
  8. This GDB was configured as "x86_64-redhat-linux-gnu"...Using host libthread_db library "/lib64/tls/libthread_db.so.1".

  9. (gdb) run <in.dip> out.out
  10. Starting program: /export/home/hujinhe/mdord.exe <in.dip> out.out
  11. [Thread debugging using libthread_db enabled]
  12. [New Thread 182894224864 (LWP 13692)]

  13. Program received signal SIGSEGV, Segmentation fault.
  14. [Switching to Thread 182894224864 (LWP 13692)]
  15. 0x000000000041e998 in rand_ ()
  16. (gdb) backtrace
  17. #0  0x000000000041e998 in rand_ ()
  18. #1  0x0000000000405c6a in start () at mdrdipord.f:559
  19. #2  0x0000000000403074 in main$mdrdipord_$BLK () at mdrdipord.f:36
  20. #3  0x000000000040302a in main ()
  21. (gdb)
复制代码


刚接触编程,有些迷糊。请问是不是第36和559行有问题?


  1. (gdb) l 36
  2. 31      C
  3. 32      C     READ IN AND INITIALISE DATA.
  4. 33            CALL SYSDEF
  5. 34      C
  6. 35      C     SET UP STARTING CONFIGURATION
  7. 36            CALL START
  8. 37      C
  9. 38      C     PRINT OUT SYSTEM PARAMETERS
  10. 39            CALL OUTPUT(1)
  11. 40      C***********************************************************************
复制代码


第36行是调用子程序START,第559行是START子程序里的一部分,如下:


  1. (gdb) l 559
  2. 554           COMMON/CMVELO/VMOM(3,NSP),ANGM(3,NSP)
  3. 555           COMMON/CMFRCS/FXYZ(3,NSP),TXYZ(3,NSP)
  4. 556           DIMENSION XB(4),YB(4),ZB(4)
  5. 557           DATA XB/0.5,-.5,0.5,-.5/,YB/0.5,-.5,-.5,0.5/,ZB/0.5,0.5,-.5,-.5/
  6. 558     C     XRANF(IDUM)=2.0*RANF()-1.0
  7. 559           XRANF(IDUM)=2.0*RAND()-1.0
  8. 560           IDUM=0
  9. 561           IF(.NOT.NLRES)GO TO 10
  10. 562           CALL AGAIN(1)
  11. 563           GO TO 32
复制代码


可我还是看不出来是哪有问题,所以要请教各位大侠,不胜感激
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表