From c479b29a129d0b0ebe4ce189cf6ddcc976e68a4a Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Sun, 31 Mar 2013 21:27:03 +0000 Subject: [PATCH] psblas3: prec/psb_c_prec_type.f90 prec/psb_d_prec_type.f90 prec/psb_s_prec_type.f90 prec/psb_z_prec_type.f90 Fixed clone method for outer prec type. --- prec/psb_c_prec_type.f90 | 23 +++++++++++++++-------- prec/psb_d_prec_type.f90 | 23 +++++++++++++++-------- prec/psb_s_prec_type.f90 | 23 +++++++++++++++-------- prec/psb_z_prec_type.f90 | 23 +++++++++++++++-------- 4 files changed, 60 insertions(+), 32 deletions(-) diff --git a/prec/psb_c_prec_type.f90 b/prec/psb_c_prec_type.f90 index bb06ecad..6a02abb0 100644 --- a/prec/psb_c_prec_type.f90 +++ b/prec/psb_c_prec_type.f90 @@ -48,15 +48,13 @@ module psb_c_prec_type generic, public :: apply => psb_c_apply2v, psb_c_apply1v,& & psb_c_apply1_vect, psb_c_apply2_vect procedure, pass(prec) :: sizeof => psb_cprec_sizeof + procedure, pass(prec) :: clone => psb_c_prec_clone end type psb_cprec_type interface psb_precfree module procedure psb_c_precfree end interface - interface psb_nullify_prec - module procedure psb_nullify_cprec - end interface interface psb_precdescr module procedure psb_cfile_prec_descr @@ -192,11 +190,6 @@ contains return end subroutine psb_c_precfree - subroutine psb_nullify_cprec(p) - type(psb_cprec_type), intent(inout) :: p - - end subroutine psb_nullify_cprec - function psb_cprec_sizeof(prec) result(val) class(psb_cprec_type), intent(in) :: prec integer(psb_long_int_k_) :: val @@ -209,4 +202,18 @@ contains end function psb_cprec_sizeof + subroutine psb_c_prec_clone(prec,precout,info) + implicit none + class(psb_cprec_type), intent(inout) :: prec + class(psb_cprec_type), intent(out) :: precout + integer(psb_ipk_), intent(out) :: info + + info = psb_success_ + + if (allocated(prec%prec)) then + call prec%prec%clone(precout%prec,info) + end if + + end subroutine psb_c_prec_clone + end module psb_c_prec_type diff --git a/prec/psb_d_prec_type.f90 b/prec/psb_d_prec_type.f90 index f7eb43d0..d8c8f271 100644 --- a/prec/psb_d_prec_type.f90 +++ b/prec/psb_d_prec_type.f90 @@ -48,15 +48,13 @@ module psb_d_prec_type generic, public :: apply => psb_d_apply2v, psb_d_apply1v,& & psb_d_apply1_vect, psb_d_apply2_vect procedure, pass(prec) :: sizeof => psb_dprec_sizeof + procedure, pass(prec) :: clone => psb_d_prec_clone end type psb_dprec_type interface psb_precfree module procedure psb_d_precfree end interface - interface psb_nullify_prec - module procedure psb_nullify_cprec - end interface interface psb_precdescr module procedure psb_dfile_prec_descr @@ -192,11 +190,6 @@ contains return end subroutine psb_d_precfree - subroutine psb_nullify_cprec(p) - type(psb_dprec_type), intent(inout) :: p - - end subroutine psb_nullify_cprec - function psb_dprec_sizeof(prec) result(val) class(psb_dprec_type), intent(in) :: prec integer(psb_long_int_k_) :: val @@ -209,4 +202,18 @@ contains end function psb_dprec_sizeof + subroutine psb_d_prec_clone(prec,precout,info) + implicit none + class(psb_dprec_type), intent(inout) :: prec + class(psb_dprec_type), intent(out) :: precout + integer(psb_ipk_), intent(out) :: info + + info = psb_success_ + + if (allocated(prec%prec)) then + call prec%prec%clone(precout%prec,info) + end if + + end subroutine psb_d_prec_clone + end module psb_d_prec_type diff --git a/prec/psb_s_prec_type.f90 b/prec/psb_s_prec_type.f90 index 8113c034..57e32d49 100644 --- a/prec/psb_s_prec_type.f90 +++ b/prec/psb_s_prec_type.f90 @@ -48,15 +48,13 @@ module psb_s_prec_type generic, public :: apply => psb_s_apply2v, psb_s_apply1v,& & psb_s_apply1_vect, psb_s_apply2_vect procedure, pass(prec) :: sizeof => psb_sprec_sizeof + procedure, pass(prec) :: clone => psb_s_prec_clone end type psb_sprec_type interface psb_precfree module procedure psb_s_precfree end interface - interface psb_nullify_prec - module procedure psb_nullify_cprec - end interface interface psb_precdescr module procedure psb_sfile_prec_descr @@ -192,11 +190,6 @@ contains return end subroutine psb_s_precfree - subroutine psb_nullify_cprec(p) - type(psb_sprec_type), intent(inout) :: p - - end subroutine psb_nullify_cprec - function psb_sprec_sizeof(prec) result(val) class(psb_sprec_type), intent(in) :: prec integer(psb_long_int_k_) :: val @@ -209,4 +202,18 @@ contains end function psb_sprec_sizeof + subroutine psb_s_prec_clone(prec,precout,info) + implicit none + class(psb_sprec_type), intent(inout) :: prec + class(psb_sprec_type), intent(out) :: precout + integer(psb_ipk_), intent(out) :: info + + info = psb_success_ + + if (allocated(prec%prec)) then + call prec%prec%clone(precout%prec,info) + end if + + end subroutine psb_s_prec_clone + end module psb_s_prec_type diff --git a/prec/psb_z_prec_type.f90 b/prec/psb_z_prec_type.f90 index b4f11a7b..430170e6 100644 --- a/prec/psb_z_prec_type.f90 +++ b/prec/psb_z_prec_type.f90 @@ -48,15 +48,13 @@ module psb_z_prec_type generic, public :: apply => psb_z_apply2v, psb_z_apply1v,& & psb_z_apply1_vect, psb_z_apply2_vect procedure, pass(prec) :: sizeof => psb_zprec_sizeof + procedure, pass(prec) :: clone => psb_z_prec_clone end type psb_zprec_type interface psb_precfree module procedure psb_z_precfree end interface - interface psb_nullify_prec - module procedure psb_nullify_cprec - end interface interface psb_precdescr module procedure psb_zfile_prec_descr @@ -192,11 +190,6 @@ contains return end subroutine psb_z_precfree - subroutine psb_nullify_cprec(p) - type(psb_zprec_type), intent(inout) :: p - - end subroutine psb_nullify_cprec - function psb_zprec_sizeof(prec) result(val) class(psb_zprec_type), intent(in) :: prec integer(psb_long_int_k_) :: val @@ -209,4 +202,18 @@ contains end function psb_zprec_sizeof + subroutine psb_z_prec_clone(prec,precout,info) + implicit none + class(psb_zprec_type), intent(inout) :: prec + class(psb_zprec_type), intent(out) :: precout + integer(psb_ipk_), intent(out) :: info + + info = psb_success_ + + if (allocated(prec%prec)) then + call prec%prec%clone(precout%prec,info) + end if + + end subroutine psb_z_prec_clone + end module psb_z_prec_type