From 14e233438ff175813e4593474e2de1206f62b648 Mon Sep 17 00:00:00 2001 From: Gustavo Marques Date: Sat, 22 May 2021 08:53:35 -0600 Subject: [PATCH] Deallocate Kd_bkgnd and Kv_bkgnd These arrays were not being deallocated which was causing a memory leak problem. --- src/parameterizations/vertical/MOM_set_diffusivity.F90 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/parameterizations/vertical/MOM_set_diffusivity.F90 b/src/parameterizations/vertical/MOM_set_diffusivity.F90 index 0cb39b2f15..d3ced12160 100644 --- a/src/parameterizations/vertical/MOM_set_diffusivity.F90 +++ b/src/parameterizations/vertical/MOM_set_diffusivity.F90 @@ -694,6 +694,8 @@ subroutine set_diffusivity(u, v, h, u_h, v_h, tv, fluxes, optics, visc, dt, & if (associated(dd%KS_extra)) deallocate(dd%KS_extra) if (associated(dd%drho_rat)) deallocate(dd%drho_rat) if (associated(dd%Kd_BBL)) deallocate(dd%Kd_BBL) + if (associated(dd%Kd_bkgnd)) deallocate(dd%Kd_bkgnd) + if (associated(dd%Kv_bkgnd)) deallocate(dd%Kv_bkgnd) if (showCallTree) call callTree_leave("set_diffusivity()")