IF ( npass.GT.maxcube ) STOP 'maxcube needs to be = 3'
IF ( nipass.GT.maxcube ) THEN
INTEGER maxcube
PARAMETER( maxcube = 1 )
PARAMETER( maxcube = 3 )
and maxcube in case you are using ptracers or cubed sphere grid)