- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there any intrinsic statement in fortran90 to deallocate all allocatable matrices at once? Something like Deallocate (ALL).... Or i have to deallocate them one by one?
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
On Windows, when an application ends, the effect is the same.
This applies to memory obtained by way of ALLOCATE in Fortran malloc/new in C/C++ (assuming non-overloaded malloc/new). On C++, the dtor would be bypassed, but the bulk memory would be returned.
You should get into the habbit of matching DEALLOCATEs with ALLOCATEs.
Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Also, if you declare ALLOCATABLE arrays local to a procedure, and have not marked them SAVE, they will be automatically deallocated when the procedure returns.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm using QuickWin features and i want to open input files consecutively from my File ---> Open menu that i have created in the QuickWin application. When i load the first file the program runs until the end... When I load the second file it says "fortrtl (151) severe: Allocatable array is already allocated" and stops! How can i avoid this without closing my QuickWin application?
PS. I haven't marked as "save" the allocatable arrays inside my procedures...
PS. I haven't marked as "save" the allocatable arrays inside my procedures...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
be sure to also check your Project/default properties.
project properties->Fortran->Data->Local variable Storage
Default Local Storage
/Qsave - all Variable SAVE)
/Qauto_scalar - scalarLocal Variable AUTOMATIC
/Qauto - Local Variables AUTOMATIC
project properties->Fortran->Data->Local variable Storage
Default Local Storage
/Qsave - all Variable SAVE)
/Qauto_scalar - scalarLocal Variable AUTOMATIC
/Qauto - Local Variables AUTOMATIC

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page