- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi there,
have a look at the following code
Module ModTmp
contains
Subroutine SubA(CSIn,CVOut)
Implicit None
Character(len=*), Intent(In) :: CSIn
Character(len=len(CSIn)), Intent(Out), Allocatable :: CVOut(:)
write(*,*) allocated(CVOut)
End Subroutine SubA
Subroutine SubB()
Implicit None
Integer(kind=8) :: c1
!$OMP PARALLEL
!$OMP DO PRIVATE(c1)
Do c1=1,2
End Do
!$OMP END DO
!$OMP END PARALLEL
end Subroutine SubB
end Module ModTmp
Program Test
use ModTmp
Character(len=20) :: CSTmp
Character(len=20), Allocatable :: CVOut(:)
call SubA(CSTmp,CVout)
write(*,*) allocated(CVOut)
end Program Test
If I compile this with
ifort -mkl -warn nounused -warn declarations -static -O3 -parallel -qopenmp
the allocation status of "cvout" in SubA changes according to whether I comment or uncomment the openmp statements in SubB.
If uncommented, "allocated(CVOut)" yields "T", if commented "allocated(CVOut)" yields "F" (as expected). This does not happen if CVOut is declared with (len=*) in SubA.
I am doing anything wrong here???
Can anybody comment on this.
Thanks a lot
Karl
NB: ifort 16.0.2, linux 4.2.0-35
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can reproduce this - it's definitely a compiler bug. Escalated as issue DPD200410321. Thanks for the nice test case.
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