diff --git a/cbind/util/psb_util_cbind.h b/cbind/util/psb_util_cbind.h index b844cd08..bede84c9 100644 --- a/cbind/util/psb_util_cbind.h +++ b/cbind/util/psb_util_cbind.h @@ -10,6 +10,6 @@ psb_i_t psb_c_i_idx2ijk(psb_i_t ijk[],psb_i_t idx,psb_i_t sizes[],psb_i_t modes, psb_i_t psb_c_l_idx2ijk(psb_i_t ijk[],psb_l_t idx,psb_i_t sizes[],psb_i_t modes,psb_i_t base); psb_i_t psb_c_i_ijk2idx(psb_i_t ijk[],psb_i_t sizes[],psb_i_t modes,psb_i_t base); psb_l_t psb_c_l_ijk2idx(psb_i_t ijk[],psb_i_t sizes[],psb_i_t modes,psb_i_t base); - +psb_i_t psb_c_dist1didx(psb_i_t n, psb_i_t np, psb_i_t base, psb_i_t indexsize, psb_i_t v[]); #endif diff --git a/cbind/util/psb_util_cbind_mod.f90 b/cbind/util/psb_util_cbind_mod.f90 index 20e124bd..1ded8136 100644 --- a/cbind/util/psb_util_cbind_mod.f90 +++ b/cbind/util/psb_util_cbind_mod.f90 @@ -96,4 +96,29 @@ contains end function + function psb_c_dist1didx(n,np,base,indexsize,v) bind(c) result(res) + use psb_base_mod, only : psb_ipk_, psb_lpk_, psb_mpk_, psb_epk_ + use psb_util_mod + implicit none + + integer(psb_c_ipk_) :: res + ! C inputs + integer(psb_c_ipk_), value :: n + integer(psb_c_ipk_), value :: np, base, indexsize + integer(psb_c_ipk_) :: v(indexsize) + + + ! Fortran variables + integer(psb_ipk_) :: fv(indexsize) + + res = -1 + + call dist1Didx(fv,n,np,base) + + v(1:indexsize) = fv(1:indexsize) + + res = 0 + + end function + end module psb_base_util_cbind_mod