- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The program
program test
character*10 s
s='AAB'
print *,index(s(1:2),'AB')
end
when compiled with 'ifort test.f' under Redhat 9 produces as output:
2
instead of the correct result, 0. Interestingly, the result is correct when the first character of the value of the variable s is not 'A'.
Output of 'ifort -V':
Intel Fortran Compiler for 32-bit applications, Version 8.0 Build 20031016Z
Package ID: l_fc_p_8.0.034
Copyright (C) 1985-2003 Intel Corporation. All rights reserved.
FOR NON-COMMERCIAL USE ONLY
program test
character*10 s
s='AAB'
print *,index(s(1:2),'AB')
end
when compiled with 'ifort test.f' under Redhat 9 produces as output:
2
instead of the correct result, 0. Interestingly, the result is correct when the first character of the value of the variable s is not 'A'.
Output of 'ifort -V':
Intel Fortran Compiler for 32-bit applications, Version 8.0 Build 20031016Z
Package ID: l_fc_p_8.0.034
Copyright (C) 1985-2003 Intel Corporation. All rights reserved.
FOR NON-COMMERCIAL USE ONLY
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Why not check the past posts to see which versions fixed the index intrinsic, and which have work-arounds for red hat 9, given that you're into running obsolete compilers and linux distros?

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