Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

deallocate all

mariospapa
Principiante
1.569 Vistas
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?
0 kudos
4 Respuestas
jimdempseyatthecove
Colaborador Distinguido III
1.569 Vistas

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

Steven_L_Intel1
Empleados
1.569 Vistas
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.
mariospapa
Principiante
1.569 Vistas
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...
bmchenry
Nuevo Colaborador II
1.569 Vistas
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
Responder