- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Consider the following code:
program test implicit none character(len=5) :: s(3), sr(3,1) s(1) = '12345' s(2) = 'ABCDE' s(3) = 'abcde' ! everything fine here sr = reshape(s,(/3,1/)) write(*,*) 'len is ',len(sr) write(*,*) 'shape is ',shape(sr) write(*,*) 'sr is ',sr write(*,*) '' ! this should be the same as before, but len is lost associate( ar => reshape(s,(/3,1/)) ) write(*,*) 'len is ',len(ar) write(*,*) 'shape is ',shape(ar) write(*,*) 'ar is ',ar end associate end program test
The output of the WRITEs inside the ASSOCIATE construct should be the same as the previous one, however I get
$ ./test
len is 5
shape is 3 1
sr is 12345ABCDEabcde
len is 0
shape is 3 1
ar is
i.e. the length of ar is zero, which I think is wrong.
$ ifort -V
Intel(R) Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 15.0 Build 20140723
Marco
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It appears to be a bug in Intel Fortran; FWIW, the example works fine in gfortran 5.0.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the nice example. Escalated to development as issue DPD200363229.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve, FortranFan, thank you.
Marco

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