public static void main(String arg[]) {

//        int[] sizes = {4};
//        int index = 4;
//        int[] indexes = new int[1];
//
//
//        for (int foo = 0; foo < 4; foo++) {
//            System.out.print(foo);
//             MmsParameter.figureOutIndexes(foo, sizes, indexes);
//
//            for (int i = 0; i < indexes.length; i++) {
//                System.out.print("  " + indexes[i]);
//            }
//            System.out.println("");
//        }

        int[] indexes = new int[3];
        MmsDimension[] dims = new MmsDimension[3];
        dims[0] = new MmsDimension("nlapse", 4);
        dims[1] = new MmsDimension("nmonth", 3);
        dims[2] = new MmsDimension("foo", 2);

        for (int ifoo = 0; ifoo < 2; ifoo++) {
            for (int imonth = 0; imonth < 3; imonth++) {
                for (int ilapse = 0; ilapse < 4; ilapse++) {
                    indexes[0] = ilapse;
                    indexes[1] = imonth;
                    indexes[2] = ifoo;
                    System.out.println(MmsParameter.figureOutIndex(dims, indexes) + " " + indexes[0] + " " + indexes[1] + " " + indexes[2]);
                }
            }
        }
    }