Drift compression and final focus for intense heavy ion beams with nonperiodic, time-dependent lattice