Skip to content

Commit

Permalink
Merge remote-tracking branch 'gmarques/fix_travis_deallocation' into …
Browse files Browse the repository at this point in the history
…initialize_tidal_ctrl_vars
  • Loading branch information
alperaltuntas committed Apr 19, 2018
2 parents 5153869 + 43b7968 commit 334f124
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/core/MOM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
3 changes: 3 additions & 0 deletions src/parameterizations/vertical/MOM_KPP.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 13 additions & 10 deletions src/parameterizations/vertical/MOM_diabatic_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 334f124

Please sign in to comment.