nInterval = INT(xInterval)
nInterval = 1 + INT( -xInterval/FLOAT(averageCycle(n)) )
nInterval = nInterval*averageCycle(n) + INT(xInterval) - 1
nInterval = MOD(nInterval,averageCycle(n))
IF (dBugFlag.AND.pdiag(n,1,1).NE.nInterval)
& ' switch', pdiag(n,1,1),' ->', nInterval, xInterval
IF ( nInterval.LT.0 .OR. nInterval.GE.averageCycle(n) ) THEN
& ' error setting pdiag(n=',n,') to:', nInterval
pdiag(n,bi,bj) = nInterval
INTEGER nInterval