Skip to content

Commit

Permalink
Deallocate eta_PF_start to avoid a memory leak
Browse files Browse the repository at this point in the history
  Added a deallocate call for eta_PF_start in step_MOM_dyn_split_RK2() to
avoid a possible memory leak.  All answers are bitwise identical.
  • Loading branch information
Hallberg-NOAA committed Dec 5, 2021
1 parent f3ab52c commit eecadd2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/core/MOM_dynamics_split_RK2.F90
Original file line number Diff line number Diff line change
Expand Up @@ -895,11 +895,10 @@ subroutine step_MOM_dyn_split_RK2(u, v, h, tv, visc, Time_local, dt, forces, p_s
enddo ; enddo
enddo

! The time-averaged free surface height has already been set by the last
! call to btstep.
! The time-averaged free surface height has already been set by the last call to btstep.

! Deallocate this memory to avoid a memory leak. ###We should also revisit how this array is declared. - RWH
!### if (dyn_p_surf .and. associated(eta_PF_start)) deallocate(eta_PF_start)
! Deallocate this memory to avoid a memory leak. ### We should revisit how this array is declared. -RWH
if (dyn_p_surf .and. associated(eta_PF_start)) deallocate(eta_PF_start)

! Here various terms used in to update the momentum equations are
! offered for time averaging.
Expand Down

0 comments on commit eecadd2

Please sign in to comment.