The overhead of using ALLOCATE and DEALLOCATE same as the overhead of using malloc() and free() in C. In fact, most Fortran compilers implement (DE)ALLOCATE as wrappers around malloc()/free() with some bookkeeping added. inherent to all Fortran 90 arrays.
It is usually better to isolate a fairly large array of scratches and use it in narrow loops instead of constantly allocating and freeing memory. It also does not allow heaps to fragment, which can lead to distribution problems later (a very rare situation, but this happens, especially with 32-bit codes).
Hristo iliev
source share