- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
and if i change this pointer type to Allocatable, it works without problem. so how do I do the assignment properly.
ifort version is 10.1.008 and 10.1.006, both have the same problem, the machine is linux fedora.
can anybody help ? thanks.
PROGRAM test
IMPLICIT NONE
REAL, DIMENSION(:,:,:,:), POINTER :: a,b
INTEGER :: ierror
ALLOCATE (&
a(-1:130,-1:130,-1:30,1:6), &
b(-1:130,-1:130,-1:30,1:6), &
STAT=ierror)
a=b
print *,ierror
DEALLOCATE(a,b)
END PROGRAM test
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What happens if you replace "a=b" with a 4-level do loop?
(I know you want the "a=b")
If the problem goes away then this indicates the compiler is generating
! a=b
a =
And this definitely is not the code you intend to be generated. Unnecessary stack temporary creation is a compiler error (IMHO) and should be corrected.
If this is the problem then if newer version of compiler available try that first. Else insert preprocessor directives to perform the copy
! BugFix.inc
#define BUG_ArrayCopy
#ifdef BUG_ArrayCopy
#define call fppCOPY(Aout, Ain, size(Aout),size(Ain))
#else
Aout = Ain
#endif
...
! fppCOPY.F90
subroutine fppCOPY(Aout, Ain, Nout, Nin)
integer :: Nout, Nin
real :: Aout(Nout), Ain(Nin)
integer :: N
N=min(Nout,Nin)
Aout(1:N) = Ain(1:N)
if(Nout .gt. N) Aout(N+1:Nout) = 0.0
end subroutine fppCOPY
...
! YourSubroutine
#include "BugFix.inc"
...
fppCopy(a,b)
...
Yes it is a hack but at least it will get you going without a performance penalty. And you can create a small test suit to verify if the problem is corrected on later releases of the compiler. You might want to insert diagnostic code
if (Nout .ne. Nin) call YourBugCheck()
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tim,
I find -check:arg_temp_created useless (for the most part) since this is a run time check as opposed to a compile time information message. There should be a -warn:arg_temp_created IMHO.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The beta compiler has eliminated the case where data are stored to an unused temporary. It uses an _intel_fast_memcpy() to move data from a temporary, sometimes avoiding a loss of performance, but not avoiding the consumption of additional memory.
OP has not divulged which compiler version is under discussion, unless I missed it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page