diff --git a/src/core/MOM.F90 b/src/core/MOM.F90 index 22dbb86b15..a6da3b5333 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_KPP.F90 b/src/parameterizations/vertical/MOM_KPP.F90 index 87ce532a28..6376358fea 100644 --- a/src/parameterizations/vertical/MOM_KPP.F90 +++ b/src/parameterizations/vertical/MOM_KPP.F90 @@ -1073,7 +1073,10 @@ end subroutine KPP_NonLocalTransport_saln subroutine KPP_end(CS) type(KPP_CS), pointer :: CS !< Control structure + if (.not.associated(CS)) return + deallocate(CS) + end subroutine KPP_end !> \namespace mom_kpp diff --git a/src/parameterizations/vertical/MOM_diabatic_driver.F90 b/src/parameterizations/vertical/MOM_diabatic_driver.F90 index 70412a716b..07cfb558cd 100644 --- a/src/parameterizations/vertical/MOM_diabatic_driver.F90 +++ b/src/parameterizations/vertical/MOM_diabatic_driver.F90 @@ -2424,16 +2424,19 @@ subroutine diabatic_driver_end(CS) call entrain_diffusive_end(CS%entrain_diffusive_CSp) call set_diffusivity_end(CS%set_diff_CSp) - 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 + + ! 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%use_tidal_mixing) call tidal_mixing_end(CS%tidal_mixing_CSp) diff --git a/src/parameterizations/vertical/MOM_set_diffusivity.F90 b/src/parameterizations/vertical/MOM_set_diffusivity.F90 index a1f10519e6..77061d530e 100644 --- a/src/parameterizations/vertical/MOM_set_diffusivity.F90 +++ b/src/parameterizations/vertical/MOM_set_diffusivity.F90 @@ -886,7 +886,8 @@ subroutine find_N2(h, tv, T_f, S_f, fluxes, j, G, GV, CS, dRho_int, & z_from_bot(i) = 0.5*GV%H_to_m*h(i,j,nz) do_i(i) = (G%mask2dT(i,j) > 0.5) - if (CS%tm_csp%Int_tide_dissipation .or. CS%tm_csp%Lee_wave_dissipation) then + if ( (CS%tm_csp%Int_tide_dissipation .or. CS%tm_csp%Lee_wave_dissipation) .and. & + .not. CS%tm_csp%use_cvmix_tidal ) then h_amp(i) = sqrt(CS%tm_csp%h2(i,j)) ! for computing Nb else h_amp(i) = 0.0 diff --git a/src/parameterizations/vertical/MOM_tidal_mixing.F90 b/src/parameterizations/vertical/MOM_tidal_mixing.F90 index 53945e1c6b..dcca7d5fb5 100644 --- a/src/parameterizations/vertical/MOM_tidal_mixing.F90 +++ b/src/parameterizations/vertical/MOM_tidal_mixing.F90 @@ -63,15 +63,15 @@ module MOM_tidal_mixing logical :: debug = .true. ! Parameters - logical :: int_tide_dissipation ! Internal tide conversion (from barotropic) with - ! the schemes of St Laurent et al (2002)/ + logical :: int_tide_dissipation = .false. ! Internal tide conversion (from barotropic) + ! with the schemes of St Laurent et al (2002)/ ! Simmons et al (2004) integer :: Int_tide_profile ! A coded integer indicating the vertical profile ! for dissipation of the internal waves. Schemes that ! are currently encoded are St Laurent et al (2002) and ! Polzin (2009). - logical :: Lee_wave_dissipation ! Enable lee-wave driven mixing, following + logical :: Lee_wave_dissipation = .false. ! Enable lee-wave driven mixing, following ! Nikurashin (2010), with a vertical energy ! deposition profile specified by Lee_wave_profile. ! St Laurent et al (2002) or @@ -94,8 +94,8 @@ module MOM_tidal_mixing ! wave energy dissipation (nondimensional) real :: min_zbot_itides ! minimum depth for internal tide conversion (meter) - logical :: Lowmode_itidal_dissipation ! Internal tide conversion (from low modes) with - ! the schemes of St Laurent et al (2002)/ + logical :: Lowmode_itidal_dissipation = .false. ! Internal tide conversion (from low modes) + ! with the schemes of St Laurent et al (2002)/ ! Simmons et al (2004) !BDM real :: Nu_Polzin ! The non-dimensional constant used in Polzin form of @@ -122,8 +122,8 @@ module MOM_tidal_mixing real :: kappa_h2_factor ! factor for the product of wavenumber * rms sgs height character(len=200) :: inputdir - logical :: use_cvmix_tidal ! true if cvmix is to be used for determining diffusivity - ! due to tidal mixing + logical :: use_cvmix_tidal = .false. ! true if cvmix is to be used for determining + ! diffusivity due to tidal mixing real :: min_thickness ! Minimum thickness allowed [m] @@ -372,6 +372,10 @@ logical function tidal_mixing_init(Time, G, GV, param_file, diag, diag_to_Z_CSp, call get_param(param_file, mdl, "MIN_ZBOT_ITIDES", CS%min_zbot_itides, & "Turn off internal tidal dissipation when the total \n"//& "ocean depth is less than this value.", units="m", default=0.0) + endif + + if ( (CS%Int_tide_dissipation .or. CS%Lee_wave_dissipation) .and. & + .not. CS%use_cvmix_tidal) then call safe_alloc_ptr(CS%Nb,isd,ied,jsd,jed) call safe_alloc_ptr(CS%h2,isd,ied,jsd,jed)