- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all. I met an error seems come with the function of rand().
I'm using the Intel.Fortran.Compiler.8.1.021 (non commercial version) on a redhat linux enterprise v3.
Here is a simple test done in my computer. I just cannot understand what happening with this simple program. It runs good with my Compaq Fortran Compiler in Windows.
Please help and thanks in advance.
Regards,
Xingzhi
$ cat test.f
program testttt
integer Ns
parameter (Ns=16)
C
integer i
double precision htx
C
Do i=1,Ns
integer Ns
parameter (Ns=16)
C
integer i
double precision htx
C
Do i=1,Ns
htx=rand()
print *, i,htx
print *, i,htx
End Do
C
End program
C
End program
$ifort test.f
$./a.out
$./a.out
forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image PC Routine Line Source
a.out 0804A3C0 Unknown Unknown Unknown
a.out 0804A228 Unknown Unknown Unknown
Unknown 4024179D Unknown Unknown Unknown
a.out 0804A0E1 Unknown Unknown Unknown
Image PC Routine Line Source
a.out 0804A3C0 Unknown Unknown Unknown
a.out 0804A228 Unknown Unknown Unknown
Unknown 4024179D Unknown Unknown Unknown
a.out 0804A0E1 Unknown Unknown Unknown
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As the for_lib.pdf shows, add
use ifport
use ifport
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you tim18,
Actually, I added a comma in the (), namely "rand(,)", the program runs...don't know why:)
Regards,
Xingzhi

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page