View previous topic :: View next topic |
Author |
Message |
dgurok
Joined: 26 May 2011 Posts: 66
|
Posted: Tue Dec 11, 2018 9:33 am Post subject: Problem with ALLOCATE |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7933 Location: Salford, UK
|
Posted: Tue Dec 11, 2018 10:14 am Post subject: |
|
|
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 |
|
|
|