diff --git a/mlprec/mld_c_prec_type.f90 b/mlprec/mld_c_prec_type.f90 index cf188349..3918de01 100644 --- a/mlprec/mld_c_prec_type.f90 +++ b/mlprec/mld_c_prec_type.f90 @@ -755,18 +755,19 @@ contains implicit none class(mld_cprec_type), intent(inout) :: prec - class(psb_cprec_type), intent(out) :: precout + class(psb_cprec_type), intent(inout) :: precout integer(psb_ipk_), intent(out) :: info - call mld_c_inner_clone(prec,precout,info) + call precout%free(info) + if (info == 0) call mld_c_inner_clone(prec,precout,info) end subroutine mld_c_clone subroutine mld_c_inner_clone(prec,precout,info) implicit none - class(mld_cprec_type), intent(inout) :: prec - class(psb_cprec_type), target, intent(out) :: precout + class(mld_cprec_type), intent(inout) :: prec + class(psb_cprec_type), target, intent(inout) :: precout integer(psb_ipk_), intent(out) :: info ! Local vars integer(psb_ipk_) :: i, j, il1, ln, lname, lev diff --git a/mlprec/mld_d_prec_type.f90 b/mlprec/mld_d_prec_type.f90 index 56413155..c6933aa4 100644 --- a/mlprec/mld_d_prec_type.f90 +++ b/mlprec/mld_d_prec_type.f90 @@ -755,18 +755,19 @@ contains implicit none class(mld_dprec_type), intent(inout) :: prec - class(psb_dprec_type), intent(out) :: precout + class(psb_dprec_type), intent(inout) :: precout integer(psb_ipk_), intent(out) :: info - call mld_d_inner_clone(prec,precout,info) + call precout%free(info) + if (info == 0) call mld_d_inner_clone(prec,precout,info) end subroutine mld_d_clone subroutine mld_d_inner_clone(prec,precout,info) implicit none - class(mld_dprec_type), intent(inout) :: prec - class(psb_dprec_type), target, intent(out) :: precout + class(mld_dprec_type), intent(inout) :: prec + class(psb_dprec_type), target, intent(inout) :: precout integer(psb_ipk_), intent(out) :: info ! Local vars integer(psb_ipk_) :: i, j, il1, ln, lname, lev diff --git a/mlprec/mld_s_prec_type.f90 b/mlprec/mld_s_prec_type.f90 index b8b68fde..a16f3e1c 100644 --- a/mlprec/mld_s_prec_type.f90 +++ b/mlprec/mld_s_prec_type.f90 @@ -755,18 +755,19 @@ contains implicit none class(mld_sprec_type), intent(inout) :: prec - class(psb_sprec_type), intent(out) :: precout + class(psb_sprec_type), intent(inout) :: precout integer(psb_ipk_), intent(out) :: info - call mld_s_inner_clone(prec,precout,info) + call precout%free(info) + if (info == 0) call mld_s_inner_clone(prec,precout,info) end subroutine mld_s_clone subroutine mld_s_inner_clone(prec,precout,info) implicit none - class(mld_sprec_type), intent(inout) :: prec - class(psb_sprec_type), target, intent(out) :: precout + class(mld_sprec_type), intent(inout) :: prec + class(psb_sprec_type), target, intent(inout) :: precout integer(psb_ipk_), intent(out) :: info ! Local vars integer(psb_ipk_) :: i, j, il1, ln, lname, lev diff --git a/mlprec/mld_z_prec_type.f90 b/mlprec/mld_z_prec_type.f90 index 2c565b3d..b9845db2 100644 --- a/mlprec/mld_z_prec_type.f90 +++ b/mlprec/mld_z_prec_type.f90 @@ -755,18 +755,19 @@ contains implicit none class(mld_zprec_type), intent(inout) :: prec - class(psb_zprec_type), intent(out) :: precout + class(psb_zprec_type), intent(inout) :: precout integer(psb_ipk_), intent(out) :: info - call mld_z_inner_clone(prec,precout,info) + call precout%free(info) + if (info == 0) call mld_z_inner_clone(prec,precout,info) end subroutine mld_z_clone subroutine mld_z_inner_clone(prec,precout,info) implicit none - class(mld_zprec_type), intent(inout) :: prec - class(psb_zprec_type), target, intent(out) :: precout + class(mld_zprec_type), intent(inout) :: prec + class(psb_zprec_type), target, intent(inout) :: precout integer(psb_ipk_), intent(out) :: info ! Local vars integer(psb_ipk_) :: i, j, il1, ln, lname, lev