@Test
    public void testTimeStep_MONTHLY_MEAN_subdivide() throws Exception {
        printDebug("----------------------------");
        printDebug("Monthly Mean with subdivide: " + this.toString());
        printDebug("----------------------------");
        // Data
        CSTable t = DataIO.table(r, "obs");
        Assert.assertNotNull(t);
        // Subdivide
        CSTable sdt = DataIO.table(sdr,"sd");
        Assert.assertNotNull(sdt);
        
        
        // 4 YEARS
        Date start = Conversions.convert("1980-10-01", Date.class);
        Date end = Conversions.convert("1984-11-30", Date.class);

         
        int periodStart=Jan;
        boolean[] periodMask = {true, true, true, true,
                                true, true, true, true,
                                true, true, true, false};
       
        
        double[] subDivideData = DataIO.getColumnDoubleValuesInterval(start, end, sdt, "sd_data", DataIO.DAILY, 0, null, null);
        boolean[] subDivideMask = new boolean[subDivideData.length];
        for (int i=0; i<subDivideMask.length; i++) {
            subDivideMask[i] = (subDivideData[i] == 2);
            //System.out.println("SDmask["+i+"] = " + subDivideMask[i] + " with data " + subDivideData[i]);
        }
        
        
        double[] mean = DataIO.getColumnDoubleValuesInterval(start, end, t, "runoff[0]", DataIO.MONTHLY_MEAN, periodStart, periodMask, subDivideMask);
        //Assert.assertTrue(mean.length == 1);
       
       

        double[] goldenMean = new double[2];
        double goldenSum = 0;
        goldenSum += 105;
        goldenSum += 102;
        goldenSum += 99;
        goldenSum += 97;
        goldenSum += 96;
        goldenSum += 93;
        goldenSum += 94;
        goldenSum += 92;
        goldenSum += 91;
        goldenSum += 90;
        goldenSum += 93;
        goldenSum += 91;
        goldenSum += 89;
        goldenSum += 86;
        goldenSum += 89;
//        goldenSum += 78;
       
        goldenMean[0] = goldenSum/15;
        goldenMean[1] = 78;
        printDebug("Read data length = " + mean.length + ";  goldenMean length = " + goldenMean.length);
        for (int i = 0; i < goldenMean.length; i++) {
            printDebug("MonthlyMean[" + i + "] = " + mean[i] + ";\tGolden MonthlyMean[" + i + "] = " + goldenMean[i]);

        }

        Assert.assertArrayEquals(goldenMean, mean, 0);
    }