Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions sorc/ncep_post.fd/DEALLOCATE.f
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ SUBROUTINE DE_ALLOCATE
deallocate(stc)
deallocate(sh2o)
deallocate(SLDPTH)
deallocate(CAPE)
deallocate(CIN)
deallocate(IFI_APCP)
deallocate(RTDPTH)
deallocate(SLLEVEL)
!
Expand Down
22 changes: 22 additions & 0 deletions sorc/ncep_post.fd/IFI.F
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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

Expand Down