From 2800524c2280b3c3dc68ff75687cb28568ed993b Mon Sep 17 00:00:00 2001 From: Gustavo Marques Date: Thu, 19 Apr 2018 09:12:28 -0600 Subject: [PATCH] Uncomment calls to deallocate KPP related arrays --- src/core/MOM.F90 | 2 +- .../vertical/MOM_diabatic_driver.F90 | 22 +++++++++---------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/core/MOM.F90 b/src/core/MOM.F90 index a6da3b5333..22dbb86b15 100644 --- a/src/core/MOM.F90 +++ b/src/core/MOM.F90 @@ -2901,7 +2901,7 @@ subroutine MOM_end(CS) call tracer_registry_end(CS%tracer_Reg) call tracer_flow_control_end(CS%tracer_flow_CSp) - !if (associated(CS%diabatic_CSp)) call diabatic_driver_end(CS%diabatic_CSp) + if (associated(CS%diabatic_CSp)) call diabatic_driver_end(CS%diabatic_CSp) if (CS%offline_tracer_mode) call offline_transport_end(CS%offline_CSp) diff --git a/src/parameterizations/vertical/MOM_diabatic_driver.F90 b/src/parameterizations/vertical/MOM_diabatic_driver.F90 index 07cfb558cd..be8dafc10b 100644 --- a/src/parameterizations/vertical/MOM_diabatic_driver.F90 +++ b/src/parameterizations/vertical/MOM_diabatic_driver.F90 @@ -2425,18 +2425,16 @@ subroutine diabatic_driver_end(CS) call entrain_diffusive_end(CS%entrain_diffusive_CSp) call set_diffusivity_end(CS%set_diff_CSp) - ! GMM, commeting the following because it fails on Travis (gfortran) - - ! if (CS%useKPP) then - ! if (allocated(CS%KPP_buoy_flux)) deallocate( CS%KPP_buoy_flux ) - ! if (allocated(CS%KPP_temp_flux)) deallocate( CS%KPP_temp_flux ) - ! if (allocated(CS%KPP_salt_flux)) deallocate( CS%KPP_salt_flux ) - ! endif - ! if (CS%useKPP) then - ! if (allocated(CS%KPP_NLTheat)) deallocate( CS%KPP_NLTheat ) - ! if (allocated(CS%KPP_NLTscalar)) deallocate( CS%KPP_NLTscalar ) - ! call KPP_end(CS%KPP_CSp) - ! endif + if (CS%useKPP) then + deallocate( CS%KPP_buoy_flux ) + deallocate( CS%KPP_temp_flux ) + deallocate( CS%KPP_salt_flux ) + endif + if (CS%useKPP) then + deallocate( CS%KPP_NLTheat ) + deallocate( CS%KPP_NLTscalar ) + call KPP_end(CS%KPP_CSp) + endif if (CS%use_tidal_mixing) call tidal_mixing_end(CS%tidal_mixing_CSp)