- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I received the following error message when I run my complied file (I used '-g -traceback' to find exactly where the problem is
forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image PC Routine Line Source
nopar 0000000000ED5149 Unknown Unknown Unknown
nopar 0000000000ED3AC0 Unknown Unknown Unknown
nopar 0000000000E81E72 Unknown Unknown Unknown
nopar 0000000000E35763 Unknown Unknown Unknown
nopar 0000000000E3B82B Unknown Unknown Unknown
libpthread.so.0 000014712C904630 Unknown Unknown Unknown
nopar 0000000000CDC0FB varset2_hru_ 209 varset2_hru.f
nopar 0000000000CAF975 subbasin_ 240 subbasin.f
nopar 00000000004B1AA8 command_ 133 command.f
nopar 0000000000C5B8C4 simulate_ 242 simulate.f
nopar 0000000000526D50 swat_main_ 115 main.f
nopar 0000000000C75539 MAIN__ 15 smrt_main.f
nopar 0000000000402D76 Unknown Unknown Unknown
libc.so.6 000014712C345555 Unknown Unknown Unknown
nopar 0000000000402C69 Unknown Unknown Unknown
I attached the source code where it showed problems, and variables are listed below.
real, dimension (:), allocatable :: hhqday
real, dimension (:,:), allocatable :: hhqday_hru
allocate (hhqday(nstep))
allocate (hhqday_hru(mhru,nstep))
I tried Line 210 to 214 to represent what I want, but the same error occurred.
I found that Line 305 is also having similar problems too.
What I want to do is just save the values from one variable to another variable with different dimensions.
Can anyone help me with this? Thank you very much.
Siyu
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
P.S. I run the program in a Linux system, and I used 'limit' to check the memory, the 'stacksize' is unlimited.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
One thing that comes to mind: is the value of j within the range 1:mhru? You can compile the source code with the option to check the array bounds, -check bounds (or even -check all).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thank you, I used -check bounds to compile the source code, j is within the range of 1:mhru.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Okay, an alternative approach: run it in the debugger. That should be able to tell you more about what is going wrong.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just as @Arjen_Markus said -- please run your program under gdb in order to obtain the exact location of the faulting IP.
The attached 'traceback' out is not very informative.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The vast majority of the variables listed in your attached file are IMPLICIT variables and/or declared/defined in module parm.
The first step in resolving any problems would be to insert IMPLICIT NONE at the beginning of the subroutine, and then sort out issues with potential undeclared variables. This may be due to typographical errors.
Jim Dempsey
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page