icomptest = icompmem (ichknum-1)
icomptest = icomptest + 1
if ( icomp .eq. icomptest ) then
integer icomptest
icomptest = 0
nbeg = icomptest