- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I found a problem with ifort 18.0.3 on a x86_64 machine. This code
PROGRAM bug
IMPLICIT NONE
INTEGER(SELECTED_INT_KIND(9)) :: i
INTEGER(SELECTED_INT_KIND(18)) :: nobs,k8=10000000,i8
INTEGER, ALLOCATABLE :: obs(:),temp_obs(:)
ALLOCATE(obs(10000000))
nobs=0
DO i8=1,INT(HUGE(i),KIND=8)*2 - 1000000
i=1 ! replacement for READ(...)i
nobs=nobs+1
IF (nobs==k8) THEN
k8=2*k8
END IF
IF (nobs>SIZE(obs,KIND=8)) THEN
ALLOCATE(temp_obs(2*SIZE(obs,KIND=8)))
temp_obs(:SIZE(obs,KIND=8))=obs ! temp_obs(1:SIZE ... fixes this!
PRINT*,temp_obs(1),nobs
CALL MOVE_ALLOC(temp_obs,obs)
PRINT*,obs(1),nobs
IF (obs(1) /= 1) STOP 'this is wrong'
END IF
obs(nobs)=i
END DO
STOP 'finished without error'
END PROGRAM bug
shows that the
temp_obs(:SIZE(obs,KIND=8))=obs
line does not work right - it seems to zero the temp_obs array, instead of copying the obs array.
The bug is not triggered if the line is replaced by
temp_obs(1:SIZE(obs,KIND=8))=obs
The bug is not present in gfortran.
Warning: you need a machine with enough RAM - 24 GB is enough; maybe 16GB suffices.
Thanks,
Kay
Link Copied
0 Replies
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