Skip to content

Commit 08f303a

Browse files
authored
Merge pull request certik#45 from certik/alloc
Declare `lam` as an array
2 parents 8f3959d + 638b9a5 commit 08f303a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/best-practices.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,13 +444,13 @@ memory automatically and it is not possible to create memory leaks.
444444
For example you can allocate it inside a subroutine::
445445

446446
subroutine foo(lam)
447-
real(dp), allocatable, intent(out) :: lam
447+
real(dp), allocatable, intent(out) :: lam(:)
448448
allocate(lam(5))
449449
end subroutine
450450

451451
And use somewhere else::
452452

453-
real(dp), allocatable :: lam
453+
real(dp), allocatable :: lam(:)
454454
call foo(lam)
455455

456456
When the ``lam`` symbol goes out of scope, Fortran will deallocate it. If

0 commit comments

Comments
 (0)