for i, tri in enumerate(trimestres):

    # ano, membro, lat, lon
    y_season = np.full((itime, 20, 72, 109), np.nan)

    for a, y in enumerate(ltime):

        data_all, seaccum, monaccum, seamean, monmean, \
        lats, lons = post.PostModel(fcst_month, ntrimetres[i], y,
                                    model='RSM97')

        # Faz o acumulado da estação
        r = 31 * len(ntrimetres[i])
        data_all = np.nansum(np.swapaxes(data_all, 1, 2) \
                   .reshape(r, 20, 72, 109), axis=0)

        y_season[a, :] = data_all[:]

    y_season = np.swapaxes(y_season, 0, 1)

    # Usado no hindcast
    fname = 'pcp-seasonacc-rsm97-hind8110-{0}-8110-{1}.nc' \
            .format(fcst_month, tri.upper())
    writenc4(y_season, lats, lons, fname, itime, nmon[i])

    # Usado no forecast
    # fname = 'pcp-seasonacc-rsm97-hind8110-{0}{2}_{2}{1}.nc' \
            # .format(fcst_month, tri.upper(), y)
    # writenc4(y_season, lats, lons, fname, itime)
        # Faz o acumulado da estação
        r = 31 * len(ntrimetres[i])
        data_all = np.nansum(np.swapaxes(data_all, 1, 2) \
                   .reshape(r, 20, 72, 109), axis=0)

        y_season[a, :] = data_all[:]

    y_season = np.swapaxes(y_season, 0, 1)

    # Usado no hindcast
    yy = 1981
    mm = ntrimetres[i][0]
    if mm > 12:
        yy = 1982
        mm = mm - 12
    fname = 'pcp-seasonacc-rsm97-hind8110-{0}-8110-{1}.nc' \
        .format(fcst_month, tri.upper())
    writenc4(y_season, lats, lons, fname, itime,
        fcst_month, mm, yy)
    fname = 'pcp-seasonacc-rsm97-hind8110-{0}-8110-{1}' \
        .format(fcst_month, tri.upper())
    np.save(fname, y_season)

    # Usado no forecast
    # fname = 'pcp-seasonacc-rsm97-hind8110-{0}{2}_{2}{1}.nc' \
            # .format(fcst_month, tri.upper(), y)
    # writenc4(y_season, lats, lons, fname, itime)

    # raw_input('Enter...')