# Is allocate a function or subroutine?

**URL:** https://fortran-lang.discourse.group/t/is-allocate-a-function-or-subroutine/2771
**Category:** Help
**Created:** [February 11, 2022, 10:08pm UTC](https://fortran-lang.discourse.group/t/is-allocate-a-function-or-subroutine/2771 "2022-02-11T22:08:10Z")
**Posts on this page:** 1
**Page:** 2

<div class="post-metadata">

### Author: ![gnikit](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/gnikit/32/1213_2.png) [@gnikit](https://fortran-lang.discourse.group/u/gnikit)
#### Post date: [November 5, 2023, 9:08am UTC](https://fortran-lang.discourse.group/t/is-allocate-a-function-or-subroutine/2771/21 "2023-11-05T09:08:37Z")

</div>

My experiences are very similar. To get a radiation transport FEM code (7D) to have adaptive meshing I had to jump through all sorts of hoops. I opted for @certik 's solution, using a 1D array and storing separately the indices to access it. Honestly though, it made for an extremely frustrating and unnatural development experience. Having the ability, efficiently and laconically append/reallocate/resize Fortran arrays would have made a big difference.

[Previous page](https://fortran-lang.discourse.group/t/is-allocate-a-function-or-subroutine/2771.md?page=1)
