Silverfrost Forums

Welcome to our forums

error with Allocate ( array(n), stat=li(56) )

23 Oct 2013 9:50 #13211

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

   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

24 Oct 2013 6:51 #13214

Strange? What happens if you use integer1 or integer2 for li?

24 Oct 2013 8:07 #13215

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.

24 Oct 2013 2:21 #13217

I will log this for investigation. Presumably using a scalar variable is OK.

24 Oct 2013 6:56 #13218

It works with scalars and scalar components of derived types.

It just doesn't like arrays.

4 Mar 2014 8:26 #13780

This bug has now been fixed for the next release.

Please login to reply.