Skip to content

Commit

Permalink
Add code to cleanup structures associated with Bcast_comm
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Kokron authored and Dan Kokron committed May 15, 2023
1 parent bfd88ed commit bf32119
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions model/fv_arrays.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1848,11 +1848,12 @@ end subroutine allocate_fv_atmos_type

!>@brief The subroutine 'deallocate_fv_atmos_type' deallocates the fv_atmos_type.
subroutine deallocate_fv_atmos_type(Atm)
use mpi

implicit none
type(fv_atmos_type), intent(INOUT) :: Atm

integer :: n
integer :: n,ierr

if (.not.Atm%allocated) return
deallocate ( Atm%u )
Expand Down Expand Up @@ -2068,7 +2069,8 @@ subroutine deallocate_fv_atmos_type(Atm)
call deallocate_fv_nest_BC_type(Atm%neststruct%delz_BC)
endif
#endif

if(allocated(Atm%Bcast_ranks)) deallocate(Atm%Bcast_ranks)
if(Atm%Bcast_comm /= MPI_COMM_NULL) call MPI_Comm_free(Atm%Bcast_comm,ierr)
end if

if (Atm%flagstruct%grid_type < 4) then
Expand Down

0 comments on commit bf32119

Please sign in to comment.