Skip to content

Commit

Permalink
fix memleak in med_phases_prep_ocn_mod
Browse files Browse the repository at this point in the history
  • Loading branch information
alperaltuntas committed May 20, 2019
1 parent 1ca2910 commit 1586bf1
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 1586bf1

Please sign in to comment.