Skip to content

Commit

Permalink
Release the memory allocated in the mhd module
Browse files Browse the repository at this point in the history
  • Loading branch information
mathrack committed Apr 22, 2024
1 parent a1ec640 commit 380017c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/mhd.f90
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,17 @@ subroutine mhd_fin()

implicit none

! Close the IO unit opened in the subroutine mhd_sta
if (nrank==0) close(mhd_iounit)

! Release memory
if (allocated(Bmean)) deallocate(Bmean)
if (allocated(Bm)) deallocate(Bm)
if (allocated(magelf)) deallocate(magelf)
if (allocated(Je)) deallocate(Je)
if (allocated(dBm)) deallocate(dBm)
if (allocated(elcpot)) deallocate(elcpot)

end subroutine mhd_fin
!
subroutine int_time_magnet
Expand Down

0 comments on commit 380017c

Please sign in to comment.