diff --git a/amgprec/impl/smoother/amg_d_poly_smoother_clone_settings.f90 b/amgprec/impl/smoother/amg_d_poly_smoother_clone_settings.f90 index 3b2e81de..5912b2d7 100644 --- a/amgprec/impl/smoother/amg_d_poly_smoother_clone_settings.f90 +++ b/amgprec/impl/smoother/amg_d_poly_smoother_clone_settings.f90 @@ -61,7 +61,12 @@ subroutine amg_d_poly_smoother_clone_settings(sm,smout,info) smout%rho_ba = sm%rho_ba smout%rho_estimate = sm%rho_estimate smout%rho_estimate_iterations = sm%rho_estimate_iterations - smout%poly_beta = sm%poly_beta + if (allocated(sm%poly_beta)) then + smout%poly_beta = sm%poly_beta + else + if (allocated(smout%poly_beta)) deallocate(smout%poly_beta) + end if + if (allocated(smout%sv)) then if (.not.same_type_as(sm%sv,smout%sv)) then diff --git a/amgprec/impl/smoother/amg_s_poly_smoother_clone_settings.f90 b/amgprec/impl/smoother/amg_s_poly_smoother_clone_settings.f90 index a7b3108b..0634c76e 100644 --- a/amgprec/impl/smoother/amg_s_poly_smoother_clone_settings.f90 +++ b/amgprec/impl/smoother/amg_s_poly_smoother_clone_settings.f90 @@ -61,7 +61,12 @@ subroutine amg_s_poly_smoother_clone_settings(sm,smout,info) smout%rho_ba = sm%rho_ba smout%rho_estimate = sm%rho_estimate smout%rho_estimate_iterations = sm%rho_estimate_iterations - smout%poly_beta = sm%poly_beta + if (allocated(sm%poly_beta)) then + smout%poly_beta = sm%poly_beta + else + if (allocated(smout%poly_beta)) deallocate(smout%poly_beta) + end if + if (allocated(smout%sv)) then if (.not.same_type_as(sm%sv,smout%sv)) then