//NP only take the calculated subbox size if relevant for me
subhi_final=BIG;
if(myloc[idim]==idim_proc)
{
//NP can take sublo directly
sublo[idim]=bal_sublo[idim];
/*NL*/if(LMP_DEBUGMODE_LBALANCE_SIMPLE)fprintf(LMP_DEBUG_OUT_LBALANCE_SIMPLE,"original border for proc %d of dimension %d: %f, new border %f, maxshift: %f %f\n",idim_proc,idim,subhi[idim],bal_subhi[idim],-max_shift[0],max_shift[1]);
/*NL*/if(LMP_DEBUGMODE_LBALANCE_SIMPLE)fprintf(LMP_DEBUG_OUT_LBALANCE_SIMPLE," border result after min extent: %f\n",bal_subhi[idim]);
//NP make sure border is not shifted more than allowed
doublediff=bal_subhi[idim]-subhi[idim];
//if(idim == 2) fprintf(screen,"Processor %d: boundaries initally calculated for dim %d: %f / %f\n",comm->me,idim,bal_sublo[idim],bal_subhi[idim]);
if(diff<0&&diff<-max_shift[0])
subhi[idim]=subhi[idim]-max_shift[0];
elseif(diff>0&&diff>max_shift[1])
subhi[idim]=subhi[idim]+max_shift[1];
elsesubhi[idim]=bal_subhi[idim];
subhi_final=subhi[idim];
/*NL*/if(LMP_DEBUGMODE_LBALANCE_SIMPLE)fprintf(LMP_DEBUG_OUT_LBALANCE_SIMPLE," border result after max shift extent: %f\n",subhi[idim]);
//NP warn if maximum shift distance did override
if(subhi[idim]-sublo[idim]<minextent)error->warning(FLERR,"Minimum sub-domain extent could not be obeyed because particles would have been lost (did you insert large particles?). Inaccuracies may result.");
//if(idim ==2) fprintf(screen,"Processor %d: boundaries finally calculated for dim %d: %f / %f\n",comm->me,idim,sublo[idim],subhi[idim]);
}
//NP comunicate subhi that came out of the calculation to all procs
/*NL*/if(LMP_DEBUGMODE_LBALANCE_SIMPLE&&comm->me==0)fprintf(LMP_DEBUG_OUT_LBALANCE_SIMPLE,"FINAL result for proc %d of dimension %d: %f\n",idim_proc,idim,bal_subhi[idim]);
/*NL*/if(LMP_DEBUGMODE_LBALANCE_SIMPLE_RESULTS&&comm->me==0)fprintf(LMP_DEBUG_OUT_LBALANCE_SIMPLE,"FINAL result for proc %d of dimension %d: %f\n",idim_proc,idim,bal_subhi[idim]);