You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An already allocated array cannot be allocated again without prior deallocation. Similarly, deallocation can only be invoked for allocated arrays. To reallocate an array use
if (allocated(lam)) deallocate(lam)
allocate(lam(10))
I think allocation-on-assignment should be mentioned, since that will often make code simpler. I may submit a PR.
The text was updated successfully, but these errors were encountered:
The information at https://fortran-lang.org/en/learn/best_practices/allocatable_arrays/ is correct, but in the snippet
An already allocated array cannot be allocated again without prior deallocation. Similarly, deallocation can only be invoked for allocated arrays. To reallocate an array use
I think allocation-on-assignment should be mentioned, since that will often make code simpler. I may submit a PR.
The text was updated successfully, but these errors were encountered: