replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - error with Allocate ( array(n), stat=li(56) )
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

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

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2615
Location: Sydney

PostPosted: Wed Oct 23, 2013 10:50 pm    Post subject: error with Allocate ( array(n), stat=li(56) ) Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8210
Location: Salford, UK

PostPosted: Thu Oct 24, 2013 7:51 am    Post subject: Reply with quote

Strange? What happens if you use integer*1 or integer*2 for li?
Back to top
View user's profile Send private message AIM Address
davidb



Joined: 17 Jul 2009
Posts: 560
Location: UK

PostPosted: Thu Oct 24, 2013 9:07 am    Post subject: Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8210
Location: Salford, UK

PostPosted: Thu Oct 24, 2013 3:21 pm    Post subject: Reply with quote

I will log this for investigation.
Presumably using a scalar variable is OK.
Back to top
View user's profile Send private message AIM Address
davidb



Joined: 17 Jul 2009
Posts: 560
Location: UK

PostPosted: Thu Oct 24, 2013 7:56 pm    Post subject: Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8210
Location: Salford, UK

PostPosted: Tue Mar 04, 2014 9:26 am    Post subject: Reply with quote

This bug has now been fixed for the next release.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group