diff --git a/sorc/ncep_post.fd/DEALLOCATE.f b/sorc/ncep_post.fd/DEALLOCATE.f index 4c0c0d094..75301bfc5 100644 --- a/sorc/ncep_post.fd/DEALLOCATE.f +++ b/sorc/ncep_post.fd/DEALLOCATE.f @@ -139,6 +139,9 @@ SUBROUTINE DE_ALLOCATE deallocate(stc) deallocate(sh2o) deallocate(SLDPTH) + deallocate(CAPE) + deallocate(CIN) + deallocate(IFI_APCP) deallocate(RTDPTH) deallocate(SLLEVEL) ! diff --git a/sorc/ncep_post.fd/IFI.F b/sorc/ncep_post.fd/IFI.F index 6df7215d1..2b910cc99 100644 --- a/sorc/ncep_post.fd/IFI.F +++ b/sorc/ncep_post.fd/IFI.F @@ -21,6 +21,9 @@ subroutine set_ifi_dims() ! Bogus fill value for flight levels to prevent a crash ifi_nflight = 60 + if(allocated(ifi_flight_levels)) then + deallocate(ifi_flight_levels) + endif allocate(ifi_flight_levels(ifi_nflight)) do i=1,ifi_nflight ifi_flight_levels(i) = 500*i @@ -176,6 +179,22 @@ subroutine make_communicators ! 929 format('Rank ',I0,' ista=',I0,' jsta=',I0) ! print 929,grid_rank,ista,jsta + if(allocated(ista_grid)) then + deallocate(ista_grid) + deallocate(jsta_grid) + deallocate(rearrange) + deallocate(rearrange_row1d) + deallocate(rearrange_row2d) + deallocate(row_ista) + deallocate(row_iend) + deallocate(row_comm_count) + deallocate(row_comm_displ) + deallocate(col_jsta) + deallocate(col_jend) + deallocate(col_comm_count) + deallocate(col_comm_displ) + endif + ! Get the start locations on every rank. We need this for the key, ! and for determining root ranks. allocate(ista_grid(size)) @@ -508,6 +527,9 @@ subroutine set_ifi_dims() ! Convert from integer to real: ifi_nflight = size(config_flight_levels_feet) + if(allocated(ifi_flight_levels)) then + deallocate(ifi_flight_levels) + endif allocate(ifi_flight_levels(ifi_nflight)) ifi_flight_levels = config_flight_levels_feet