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

using /Qdyncom for run time allocate common blocks

chen_wu
Beginner
685 Views

Itry to use /Qdyncom to dynamic allocate array in common block in some of subroutines for example

subroutine a1

integer m=10

real, dimension (0:m)::a,b,c

common /abc/a,b,c

....

return

end

subroutine a2

real, dimension (0:m)::x,y,z

common /abc/x,y,z

....

return

end

ifor /Qdyncom "abc" -o try try.f

My question is: before the program back to main routine, how to deallocate array in common /abc/ to release the momory?

0 Kudos
1 Reply
Steven_L_Intel1
Employee
685 Views
Please use ALLOCATABLE arrays rather than the non-standard "dynamic common" feature. Dynamic common does not work the way you think it does and it's original purpose was to allow for user-written routines for dynamic allocation. There is no way to deallocate a dynamic common.
0 Kudos
Reply