View previous topic :: View next topic |
Author |
Message |
JohnCampbell
Joined: 16 Feb 2006 Posts: 2615 Location: Sydney
|
Posted: Wed Oct 23, 2013 10:50 pm Post subject: error with Allocate ( array(n), stat=li(56) ) |
|
|
Paul,
I noticed a problem with stat=li(56) in the allocate.
li(56) is referenced, but li(15) is being updated.
Is this a valid use of stat= ?
The following example shows the problem.
I am using FTN95 Ver 6.35.0
Code: | integer*4, dimension(:), allocatable :: IJmax
integer*4 nEquat
integer li(100), i
!
nEquat = 1000
li = -1
!...Allocating arrays
allocate ( IJmax(nEquat), stat = li(56))
!
write (*,*) 'test of stat=li(56)'
do i = 1,100
write (*,*) i, li(i)
end do
end |
John |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Thu Oct 24, 2013 7:51 am Post subject: |
|
|
Strange? What happens if you use integer*1 or integer*2 for li? |
|
Back to top |
|
 |
davidb
Joined: 17 Jul 2009 Posts: 560 Location: UK
|
Posted: Thu Oct 24, 2013 9:07 am Post subject: |
|
|
Using integer*1 for Li, elements 57, 58, 59 and 60 are set to zero.
Using integer*2 for Li, elements 29 and 30 are set to zero. _________________ Programmer in: Fortran 77/95/2003/2008, C, C++ (& OpenMP), java, Python, Perl |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Thu Oct 24, 2013 3:21 pm Post subject: |
|
|
I will log this for investigation.
Presumably using a scalar variable is OK. |
|
Back to top |
|
 |
davidb
Joined: 17 Jul 2009 Posts: 560 Location: UK
|
Posted: Thu Oct 24, 2013 7:56 pm Post subject: |
|
|
It works with scalars and scalar components of derived types.
It just doesn't like arrays. _________________ Programmer in: Fortran 77/95/2003/2008, C, C++ (& OpenMP), java, Python, Perl |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Tue Mar 04, 2014 9:26 am Post subject: |
|
|
This bug has now been fixed for the next release. |
|
Back to top |
|
 |
|