Calculate trace number from shape and index of all indirect dimensions assuming a phase ordering opposite the time increments.