# Can I guarantee \`allocatable\` variables to start out not allocated?

**URL:** <https://fortran-lang.discourse.group/t/can-i-guarantee-allocatable-variables-to-start-out-not-allocated/8865>\
**Category:** Help\
**Created:** [November 21, 2024, 5:13pm UTC](https://fortran-lang.discourse.group/t/can-i-guarantee-allocatable-variables-to-start-out-not-allocated/8865 "2024-11-21T17:13:03Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![shahmoradi](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/shahmoradi/32/3151_2.png) [@shahmoradi](https://fortran-lang.discourse.group/u/shahmoradi)\
**Post date:** [November 22, 2024, 5:17pm UTC](https://fortran-lang.discourse.group/t/can-i-guarantee-allocatable-variables-to-start-out-not-allocated/8865/5 "2024-11-22T17:17:18Z")

</div>

This is a relevant discussion:

> [@Best practice: Deallocating allocatable arrays explicitly vs implicitly](https://fortran-lang.discourse.group/t/best-practice-deallocating-allocatable-arrays-explicitly-vs-implicitly/3071/8):
>
> I would only remind you that you do not get the choice of implicit deallocation in procedures when compiling with gfortran using heap arrays (gfortran -fmax-stack-var-size=10 main.f90 -o). To me, this seems to be a bug in gfortran. Intel ifort compiler has no issues with it. call testAutoDealloc call testAutoDealloc contains subroutine testAutoDealloc real, allocatable :: temp(slight_smile allocate(temp(200)) !deallocate(temp) end end

Maybe the new gfortran has improved.

---

_[View the full topic](https://fortran-lang.discourse.group/t/can-i-guarantee-allocatable-variables-to-start-out-not-allocated/8865)._
