grans_obj_Final Subroutine

private subroutine grans_obj_Final(this)

Finalizes solver and frees memory.

Type Bound

grans_obj

Arguments

Type IntentOptional Attributes Name
class(grans_obj), intent(inout) :: this

GRANS solver


Calls

proc~~grans_obj_final~~CallsGraph proc~grans_obj_final grans_obj%grans_obj_Final none~finalize~25 ResPart_set%Finalize proc~grans_obj_final->none~finalize~25 proc~respart_set_final ResPart_set%ResPart_set_Final none~finalize~25->proc~respart_set_final none~finalize~26 marker_set%Finalize proc~respart_set_final->none~finalize~26 proc~lagrangian_set_freempitype lagrangian_set%lagrangian_set_FreeMPIType proc~respart_set_final->proc~lagrangian_set_freempitype none~finalize~26->proc~respart_set_final mpi_type_free mpi_type_free proc~lagrangian_set_freempitype->mpi_type_free

Source Code

    subroutine grans_obj_Final(this)
      !> Finalizes solver and frees memory.
      implicit none
      class(grans_obj), intent(inout) :: this                                  !! GRANS solver

      ! Nullify pointers
      this%timer    => null()
      this%parallel => null()
      this%parser   => null()
      this%hdf5     => null()

      ! Deallocate allocatables
      if (allocated(this%name))       deallocate(this%name)
      if (allocated(this%outputs))    deallocate(this%outputs)
      if (allocated(this%output_var)) deallocate(this%output_var)
      if (allocated(this%VF_solver))  deallocate(this%VF_solver)

      ! Finalize derived types
      call this%RP         % Finalize()
      call this%PP         % Finalize()
      call this%IB         % Finalize()
      call this%collisions % Finalize()
      call this%VFSolver   % Finalize()
      call this%op         % Finalize()
      call this%bcs        % Finalize()
      call this%fields     % Finalize()
      call this%block      % Finalize()
      call this%monitors   % Finalize()

      return
    end subroutine grans_obj_Final