From 69b1678f6b58eda4761e959e7478cf992864fb8b Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Fri, 5 Feb 2021 17:20:43 +0100 Subject: [PATCH] Missing index base adjustment in psb_c_cdins --- cbind/base/psb_base_tools_cbind_mod.F90 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cbind/base/psb_base_tools_cbind_mod.F90 b/cbind/base/psb_base_tools_cbind_mod.F90 index 2b4f5101..dc05fd66 100644 --- a/cbind/base/psb_base_tools_cbind_mod.F90 +++ b/cbind/base/psb_base_tools_cbind_mod.F90 @@ -218,13 +218,19 @@ contains integer(psb_c_lpk_) :: ia(*),ja(*) type(psb_desc_type), pointer :: descp - integer(psb_c_ipk_) :: info + integer(psb_c_ipk_) :: ixb,info res = -1 if (c_associated(cdh%item)) then call c_f_pointer(cdh%item,descp) - call psb_cdins(nz,ia(1:nz),ja(1:nz),descp,info) + ixb = psb_c_get_index_base() + if (ixb == 1) then + call psb_cdins(nz,ia(1:nz),ja(1:nz),descp,info) + else + call psb_cdins(nz,(ia(1:nz)+(1-ixb)),(ja(1:nz)+(1-ixb)),descp,info) + end if + res = info end if return