Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Problem with an array

Anton_Helm
Beginner
764 Views
Hallo,

I have a problem with an array. When I want to change his value (for example: ind(1) = 1) then i get the following message:

[bash]forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image              PC                Routine            Line        Source             
testarray          00000000004011F3  Unknown               Unknown  Unknown
testarray          00000000004010F8  Unknown               Unknown  Unknown
testarray          0000000000401075  Unknown               Unknown  Unknown
testarray          0000000000400F9C  Unknown               Unknown  Unknown
libc.so.6          00007FAD1A46D5A6  Unknown               Unknown  Unknown
testarray          0000000000400E99  Unknown               Unknown  Unknown[/bash]

In the attachment is the full code. It's only a example of my problem. It's not possibile to send you the right code. in the file "track.f" at line 9 is my problem. When I don't write something in the array, I don't get into trouble.

Thx
----------------------
array.zip
0 Kudos
1 Solution
afellow
Novice
764 Views
You may need to first allocate the array before you write anything into it.
Try add:
allocate(ind(nsize))
before you call your track function.

View solution in original post

0 Kudos
2 Replies
afellow
Novice
765 Views
You may need to first allocate the array before you write anything into it.
Try add:
allocate(ind(nsize))
before you call your track function.
0 Kudos
Anton_Helm
Beginner
764 Views
Thanks. Founded too, but you was faster.
0 Kudos
Reply