diff --git a/amgprec/impl/aggregator/amg_c_soc1_map_bld.F90 b/amgprec/impl/aggregator/amg_c_soc1_map_bld.F90 index 4041ebe5..53892ebc 100644 --- a/amgprec/impl/aggregator/amg_c_soc1_map_bld.F90 +++ b/amgprec/impl/aggregator/amg_c_soc1_map_bld.F90 @@ -248,6 +248,7 @@ subroutine amg_c_soc1_map_bld(iorder,theta,clean_zeros,a,desc_a,nlaggr,ilaggr,in j = icol(k) ! If any of the neighbours is already assigned, ! we will not reset. + if (j>nr) cycle step1 if (ilaggr(j) > 0) cycle step1 if (abs(val(k)) > theta*sqrt(abs(diag(i)*diag(j)))) then ip = ip + 1 diff --git a/amgprec/impl/aggregator/amg_d_soc1_map_bld.F90 b/amgprec/impl/aggregator/amg_d_soc1_map_bld.F90 index de95abce..fba80c10 100644 --- a/amgprec/impl/aggregator/amg_d_soc1_map_bld.F90 +++ b/amgprec/impl/aggregator/amg_d_soc1_map_bld.F90 @@ -248,6 +248,7 @@ subroutine amg_d_soc1_map_bld(iorder,theta,clean_zeros,a,desc_a,nlaggr,ilaggr,in j = icol(k) ! If any of the neighbours is already assigned, ! we will not reset. + if (j>nr) cycle step1 if (ilaggr(j) > 0) cycle step1 if (abs(val(k)) > theta*sqrt(abs(diag(i)*diag(j)))) then ip = ip + 1 diff --git a/amgprec/impl/aggregator/amg_s_soc1_map_bld.F90 b/amgprec/impl/aggregator/amg_s_soc1_map_bld.F90 index 0a809624..857c6ff3 100644 --- a/amgprec/impl/aggregator/amg_s_soc1_map_bld.F90 +++ b/amgprec/impl/aggregator/amg_s_soc1_map_bld.F90 @@ -248,6 +248,7 @@ subroutine amg_s_soc1_map_bld(iorder,theta,clean_zeros,a,desc_a,nlaggr,ilaggr,in j = icol(k) ! If any of the neighbours is already assigned, ! we will not reset. + if (j>nr) cycle step1 if (ilaggr(j) > 0) cycle step1 if (abs(val(k)) > theta*sqrt(abs(diag(i)*diag(j)))) then ip = ip + 1 diff --git a/amgprec/impl/aggregator/amg_z_soc1_map_bld.F90 b/amgprec/impl/aggregator/amg_z_soc1_map_bld.F90 index 2c467426..50fe70a2 100644 --- a/amgprec/impl/aggregator/amg_z_soc1_map_bld.F90 +++ b/amgprec/impl/aggregator/amg_z_soc1_map_bld.F90 @@ -248,6 +248,7 @@ subroutine amg_z_soc1_map_bld(iorder,theta,clean_zeros,a,desc_a,nlaggr,ilaggr,in j = icol(k) ! If any of the neighbours is already assigned, ! we will not reset. + if (j>nr) cycle step1 if (ilaggr(j) > 0) cycle step1 if (abs(val(k)) > theta*sqrt(abs(diag(i)*diag(j)))) then ip = ip + 1