From 2074440253443412970a1048348bafecf6dcfd32 Mon Sep 17 00:00:00 2001 From: Alistair Adcroft Date: Wed, 21 May 2014 10:39:16 -0400 Subject: [PATCH] Bug fix: restored deleted allocation of virt_precip - Allocation of fluxes%virt_precip was accidentally deleted for a specific configuration of ocean-only (benchmark) - Problem manifest as segmentation fault. - No answer changes. --- config_src/solo_driver/MOM_surface_forcing.F90 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/config_src/solo_driver/MOM_surface_forcing.F90 b/config_src/solo_driver/MOM_surface_forcing.F90 index fdd2b071e9..424c68305c 100644 --- a/config_src/solo_driver/MOM_surface_forcing.F90 +++ b/config_src/solo_driver/MOM_surface_forcing.F90 @@ -1624,8 +1624,13 @@ subroutine buoyancy_forcing_linear(state, fluxes, day, dt, G, CS) if (.not.associated(fluxes%sens)) then allocate(fluxes%sens(G%isd:G%ied,G%jsd:G%jed)) ; fluxes%sens(:,:) = 0.0 endif - if (.not.associated(fluxes%heat_restore)) then - allocate(fluxes%heat_restore(G%isd:G%ied,G%jsd:G%jed)) ; fluxes%heat_restore(:,:) = 0.0 + if (CS%restorebuoy) then + if (.not.associated(fluxes%heat_restore)) then + allocate(fluxes%heat_restore(G%isd:G%ied,G%jsd:G%jed)) ; fluxes%heat_restore(:,:) = 0.0 + endif + if (.not.associated(fluxes%virt_precip)) then + allocate(fluxes%virt_precip(G%isd:G%ied,G%jsd:G%jed)) ; fluxes%virt_precip(:,:) = 0.0 + endif endif else if (.not.associated(fluxes%buoy)) then