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 

Problem with ALLOCATE

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



Joined: 26 May 2011
Posts: 66

PostPosted: Tue Dec 11, 2018 9:33 am    Post subject: Problem with ALLOCATE Reply with quote

Hello,

I try to use ALLOCATE. In my test program the code below behaves as expected. Variable has the correct dimension of 500000 and assignment is working.

Code:
CHARACTER(256), ALLOCATABLE :: TXT(:)
ALLOCATE(TXT(500000),STAT=IERR)


When I try to adapt this code in my main program, STAT returns 0, but the dimension is shown as TXT(-1:0) in Salford Debugger 7.10. No assignment is possible. Assigment provides an access violation. I wonder why it behaves different compared to my test program.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Tue Dec 11, 2018 10:14 am    Post subject: Reply with quote

Your simple test works OK because 256*500000 is less than 2GB and there is enough memory available to allocate off the heap.

If you increase the size of the character array or if there are other significant demands on available memory then you may have problems in your main program.

/CHECK has its own memory limitations for Win32.

64 bit compilation should have fewer memory issues.
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