Skip to content

Commit

Permalink
Merge pull request CESM-Development#93 from ESMCI/fix_memleak
Browse files Browse the repository at this point in the history
Fix memleak in med_phases_prep_ocn_mod
  • Loading branch information
uturuncoglu authored May 23, 2019
2 parents 7dd2ade + 1586bf1 commit 3af676b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/drivers/nuopc/mediator/med_phases_prep_ocn_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,11 @@ subroutine med_phases_prep_ocn_merge(gcomp, rc)
end if ! if sea-ice is present
end do

! Deallocate Foxx_swnet if it was allocated in this subroutine
if (.not. FB_fldchk(is_local%wrap%FBExp(compocn), 'Foxx_swnet', rc=rc)) then
deallocate(Foxx_swnet)
end if

! Output to ocean per ice thickness fraction and sw penetrating into ocean
if ( FB_fldchk(is_local%wrap%FBExp(compocn), 'Sf_afrac', rc=rc)) then
call FB_GetFldPtr(is_local%wrap%FBExp(compocn), 'Sf_afrac', fldptr1=dataptr_o, rc=rc)
Expand Down

0 comments on commit 3af676b

Please sign in to comment.