Skip to content

Commit

Permalink
Attempt to fix deallocating unallocated arrays
Browse files Browse the repository at this point in the history
* This was caught by Travis, which uses gfortran. It does not happen
with intel.
  • Loading branch information
gustavo-marques committed Apr 18, 2018
1 parent d07120c commit 5640daf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/parameterizations/vertical/MOM_diabatic_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2425,13 +2425,13 @@ 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 )
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
deallocate( CS%KPP_NLTheat )
deallocate( CS%KPP_NLTscalar )
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

Expand Down

0 comments on commit 5640daf

Please sign in to comment.