diff --git a/base/modules/penv/psi_penv_mod.F90 b/base/modules/penv/psi_penv_mod.F90 index a082ea0e..4bc18070 100644 --- a/base/modules/penv/psi_penv_mod.F90 +++ b/base/modules/penv/psi_penv_mod.F90 @@ -417,7 +417,9 @@ contains end subroutine psb_init_mpik subroutine psb_exit_mpik(ictxt,close) - use psi_comm_buffers_mod + use psi_comm_buffers_mod + use psb_mat_mod + use psb_vect_mod ! !$ use psb_rsb_mod #ifdef MPI_MOD use mpi @@ -463,8 +465,10 @@ contains end if if (close_) call mpi_finalize(info) -#endif +#endif + if (close_) call psb_clear_vect_defaults() + if (close_) call psb_clear_mat_defaults() end subroutine psb_exit_mpik diff --git a/base/modules/serial/psb_c_mat_mod.F90 b/base/modules/serial/psb_c_mat_mod.F90 index 7d727f99..a24b40e2 100644 --- a/base/modules/serial/psb_c_mat_mod.F90 +++ b/base/modules/serial/psb_c_mat_mod.F90 @@ -445,7 +445,6 @@ module psb_c_mat_mod module procedure psb_lc_get_mat_default end interface - ! == =================================== ! ! @@ -1872,6 +1871,14 @@ contains end function psb_c_get_base_mat_default + subroutine psb_c_clear_mat_default() + implicit none + + if (allocated(psb_c_base_mat_default)) then + deallocate(psb_c_base_mat_default) + end if + + end subroutine psb_c_clear_mat_default @@ -2382,6 +2389,14 @@ contains end function psb_lc_get_base_mat_default + subroutine psb_lc_clear_mat_default() + implicit none + + if (allocated(psb_lc_base_mat_default)) then + deallocate(psb_lc_base_mat_default) + end if + + end subroutine psb_lc_clear_mat_default diff --git a/base/modules/serial/psb_c_vect_mod.F90 b/base/modules/serial/psb_c_vect_mod.F90 index c7a9a074..b2d224d5 100644 --- a/base/modules/serial/psb_c_vect_mod.F90 +++ b/base/modules/serial/psb_c_vect_mod.F90 @@ -161,6 +161,14 @@ contains end function psb_c_get_vect_default + subroutine psb_c_clear_vect_default() + implicit none + + if (allocated(psb_c_base_vect_default)) then + deallocate(psb_c_base_vect_default) + end if + + end subroutine psb_c_clear_vect_default function psb_c_get_base_vect_default() result(res) implicit none @@ -174,7 +182,6 @@ contains end function psb_c_get_base_vect_default - subroutine c_vect_clone(x,y,info) implicit none class(psb_c_vect_type), intent(inout) :: x @@ -229,7 +236,6 @@ contains end subroutine c_vect_bld_mn - subroutine c_vect_bld_en(x,n,mold) integer(psb_epk_), intent(in) :: n class(psb_c_vect_type), intent(inout) :: x diff --git a/base/modules/serial/psb_d_mat_mod.F90 b/base/modules/serial/psb_d_mat_mod.F90 index b0b5fef3..b9abd069 100644 --- a/base/modules/serial/psb_d_mat_mod.F90 +++ b/base/modules/serial/psb_d_mat_mod.F90 @@ -445,7 +445,6 @@ module psb_d_mat_mod module procedure psb_ld_get_mat_default end interface - ! == =================================== ! ! @@ -1872,6 +1871,14 @@ contains end function psb_d_get_base_mat_default + subroutine psb_d_clear_mat_default() + implicit none + + if (allocated(psb_d_base_mat_default)) then + deallocate(psb_d_base_mat_default) + end if + + end subroutine psb_d_clear_mat_default @@ -2382,6 +2389,14 @@ contains end function psb_ld_get_base_mat_default + subroutine psb_ld_clear_mat_default() + implicit none + + if (allocated(psb_ld_base_mat_default)) then + deallocate(psb_ld_base_mat_default) + end if + + end subroutine psb_ld_clear_mat_default diff --git a/base/modules/serial/psb_d_vect_mod.F90 b/base/modules/serial/psb_d_vect_mod.F90 index f6244e3e..6d13b3ee 100644 --- a/base/modules/serial/psb_d_vect_mod.F90 +++ b/base/modules/serial/psb_d_vect_mod.F90 @@ -161,6 +161,14 @@ contains end function psb_d_get_vect_default + subroutine psb_d_clear_vect_default() + implicit none + + if (allocated(psb_d_base_vect_default)) then + deallocate(psb_d_base_vect_default) + end if + + end subroutine psb_d_clear_vect_default function psb_d_get_base_vect_default() result(res) implicit none @@ -174,7 +182,6 @@ contains end function psb_d_get_base_vect_default - subroutine d_vect_clone(x,y,info) implicit none class(psb_d_vect_type), intent(inout) :: x @@ -229,7 +236,6 @@ contains end subroutine d_vect_bld_mn - subroutine d_vect_bld_en(x,n,mold) integer(psb_epk_), intent(in) :: n class(psb_d_vect_type), intent(inout) :: x diff --git a/base/modules/serial/psb_i_vect_mod.F90 b/base/modules/serial/psb_i_vect_mod.F90 index 0661fbe0..2b3ad252 100644 --- a/base/modules/serial/psb_i_vect_mod.F90 +++ b/base/modules/serial/psb_i_vect_mod.F90 @@ -134,6 +134,14 @@ contains end function psb_i_get_vect_default + subroutine psb_i_clear_vect_default() + implicit none + + if (allocated(psb_i_base_vect_default)) then + deallocate(psb_i_base_vect_default) + end if + + end subroutine psb_i_clear_vect_default function psb_i_get_base_vect_default() result(res) implicit none @@ -147,7 +155,6 @@ contains end function psb_i_get_base_vect_default - subroutine i_vect_clone(x,y,info) implicit none class(psb_i_vect_type), intent(inout) :: x @@ -202,7 +209,6 @@ contains end subroutine i_vect_bld_mn - subroutine i_vect_bld_en(x,n,mold) integer(psb_epk_), intent(in) :: n class(psb_i_vect_type), intent(inout) :: x diff --git a/base/modules/serial/psb_l_vect_mod.F90 b/base/modules/serial/psb_l_vect_mod.F90 index 5d0369d6..baeb6413 100644 --- a/base/modules/serial/psb_l_vect_mod.F90 +++ b/base/modules/serial/psb_l_vect_mod.F90 @@ -135,6 +135,14 @@ contains end function psb_l_get_vect_default + subroutine psb_l_clear_vect_default() + implicit none + + if (allocated(psb_l_base_vect_default)) then + deallocate(psb_l_base_vect_default) + end if + + end subroutine psb_l_clear_vect_default function psb_l_get_base_vect_default() result(res) implicit none @@ -148,7 +156,6 @@ contains end function psb_l_get_base_vect_default - subroutine l_vect_clone(x,y,info) implicit none class(psb_l_vect_type), intent(inout) :: x @@ -203,7 +210,6 @@ contains end subroutine l_vect_bld_mn - subroutine l_vect_bld_en(x,n,mold) integer(psb_epk_), intent(in) :: n class(psb_l_vect_type), intent(inout) :: x diff --git a/base/modules/serial/psb_mat_mod.f90 b/base/modules/serial/psb_mat_mod.f90 index 7e1d2a10..9b45a06f 100644 --- a/base/modules/serial/psb_mat_mod.f90 +++ b/base/modules/serial/psb_mat_mod.f90 @@ -23,4 +23,11 @@ contains end subroutine psb_init_mat_defaults + subroutine psb_clear_mat_defaults() + call psb_s_clear_mat_default() + call psb_d_clear_mat_default() + call psb_c_clear_mat_default() + call psb_z_clear_mat_default() + end subroutine psb_clear_mat_defaults + end module psb_mat_mod diff --git a/base/modules/serial/psb_s_mat_mod.F90 b/base/modules/serial/psb_s_mat_mod.F90 index d3834cc1..a097f7c5 100644 --- a/base/modules/serial/psb_s_mat_mod.F90 +++ b/base/modules/serial/psb_s_mat_mod.F90 @@ -445,7 +445,6 @@ module psb_s_mat_mod module procedure psb_ls_get_mat_default end interface - ! == =================================== ! ! @@ -1872,6 +1871,14 @@ contains end function psb_s_get_base_mat_default + subroutine psb_s_clear_mat_default() + implicit none + + if (allocated(psb_s_base_mat_default)) then + deallocate(psb_s_base_mat_default) + end if + + end subroutine psb_s_clear_mat_default @@ -2382,6 +2389,14 @@ contains end function psb_ls_get_base_mat_default + subroutine psb_ls_clear_mat_default() + implicit none + + if (allocated(psb_ls_base_mat_default)) then + deallocate(psb_ls_base_mat_default) + end if + + end subroutine psb_ls_clear_mat_default diff --git a/base/modules/serial/psb_s_vect_mod.F90 b/base/modules/serial/psb_s_vect_mod.F90 index 0907f06e..d47e6f2a 100644 --- a/base/modules/serial/psb_s_vect_mod.F90 +++ b/base/modules/serial/psb_s_vect_mod.F90 @@ -161,6 +161,14 @@ contains end function psb_s_get_vect_default + subroutine psb_s_clear_vect_default() + implicit none + + if (allocated(psb_s_base_vect_default)) then + deallocate(psb_s_base_vect_default) + end if + + end subroutine psb_s_clear_vect_default function psb_s_get_base_vect_default() result(res) implicit none @@ -174,7 +182,6 @@ contains end function psb_s_get_base_vect_default - subroutine s_vect_clone(x,y,info) implicit none class(psb_s_vect_type), intent(inout) :: x @@ -229,7 +236,6 @@ contains end subroutine s_vect_bld_mn - subroutine s_vect_bld_en(x,n,mold) integer(psb_epk_), intent(in) :: n class(psb_s_vect_type), intent(inout) :: x diff --git a/base/modules/serial/psb_vect_mod.f90 b/base/modules/serial/psb_vect_mod.f90 index 64a33832..80e7da77 100644 --- a/base/modules/serial/psb_vect_mod.f90 +++ b/base/modules/serial/psb_vect_mod.f90 @@ -36,4 +36,16 @@ contains end subroutine psb_init_vect_defaults + subroutine psb_clear_vect_defaults() + implicit none + + call psb_i_clear_vect_default() + call psb_l_clear_vect_default() + call psb_s_clear_vect_default() + call psb_d_clear_vect_default() + call psb_c_clear_vect_default() + call psb_z_clear_vect_default() + + end subroutine psb_clear_vect_defaults + end module psb_vect_mod diff --git a/base/modules/serial/psb_z_mat_mod.F90 b/base/modules/serial/psb_z_mat_mod.F90 index 2ba886b5..ed455826 100644 --- a/base/modules/serial/psb_z_mat_mod.F90 +++ b/base/modules/serial/psb_z_mat_mod.F90 @@ -445,7 +445,6 @@ module psb_z_mat_mod module procedure psb_lz_get_mat_default end interface - ! == =================================== ! ! @@ -1872,6 +1871,14 @@ contains end function psb_z_get_base_mat_default + subroutine psb_z_clear_mat_default() + implicit none + + if (allocated(psb_z_base_mat_default)) then + deallocate(psb_z_base_mat_default) + end if + + end subroutine psb_z_clear_mat_default @@ -2382,6 +2389,14 @@ contains end function psb_lz_get_base_mat_default + subroutine psb_lz_clear_mat_default() + implicit none + + if (allocated(psb_lz_base_mat_default)) then + deallocate(psb_lz_base_mat_default) + end if + + end subroutine psb_lz_clear_mat_default diff --git a/base/modules/serial/psb_z_vect_mod.F90 b/base/modules/serial/psb_z_vect_mod.F90 index f6da1ded..a0336d86 100644 --- a/base/modules/serial/psb_z_vect_mod.F90 +++ b/base/modules/serial/psb_z_vect_mod.F90 @@ -161,6 +161,14 @@ contains end function psb_z_get_vect_default + subroutine psb_z_clear_vect_default() + implicit none + + if (allocated(psb_z_base_vect_default)) then + deallocate(psb_z_base_vect_default) + end if + + end subroutine psb_z_clear_vect_default function psb_z_get_base_vect_default() result(res) implicit none @@ -174,7 +182,6 @@ contains end function psb_z_get_base_vect_default - subroutine z_vect_clone(x,y,info) implicit none class(psb_z_vect_type), intent(inout) :: x @@ -229,7 +236,6 @@ contains end subroutine z_vect_bld_mn - subroutine z_vect_bld_en(x,n,mold) integer(psb_epk_), intent(in) :: n class(psb_z_vect_type), intent(inout) :: x