From b7ac77da69619603acf3bd113a45d156a784d73c Mon Sep 17 00:00:00 2001 From: sfilippone Date: Sat, 11 Jul 2026 12:27:03 +0200 Subject: [PATCH] Fix poly%clone allocation of poly_beta --- .../impl/smoother/amg_d_poly_smoother_clone_settings.f90 | 7 ++++++- .../impl/smoother/amg_s_poly_smoother_clone_settings.f90 | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) 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