lat = nc_file.variables["LAT"][:]  # Mude aqui
    tim = nc_file.variables["TIME"][:]  # Mude aqui

    nlon = len(lon)
    nlat = len(lat)
    ntime = 360  # Mude aqui
    nmon = ntime / 30
    nyear = ntime / 12

    tri = ("JFM", "FMA", "MAM", "AMJ", "MJJ", "JJA", "JAS", "ASO", "SON", "OND", "NDJ", "DJF")
    ini = ("01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12")

    aux = np.zeros((ntime, nlat, nlon)) * np.nan

    # SEPARA JFM, FMA, MAM...
    for k in range(0, ntime):
        aux[k, :, :] = np.sum(var[k : 3 + k, :, :], axis=0)

    # a = aux.reshape(nmon,nyear,nlat,nlon) # 1989: JFM, FMA, MAM...

    a = aux.reshape(nyear, nmon, nlat, nlon)  # 1989: JFM, 1990: JFM...

    # ESCREVE NETCDF
    for k in range(0, nmon):
        fname = output_name[i] + ".{0}.2.5dg.nc".format(tri[k])
        create_netcdf(a[:, k, :, :], lat, lon, fileout=fname, ntime=30)

    # cdo Versão 3
    # cdo genbil,pcp-daily-ec4amip51_2015AMJ.ctl.nc cmap.precip.mon.mean.1981-2010.JFM.2.5dg.nc weights.nc
    # cdo remap,pcp-daily-ec4amip51_2015AMJ.ctl.nc,weights.nc cmap.precip.mon.mean.1981-2010.JFM.2.5dg.nc cmap.precip.mon.mean.1981-2010.JFM.T42.nc
    # Captura a maskara usada no arquivo de entrada
    var = np.where(np.ma.getmask(var[:, :, :]), np.NaN, var)

    nlon = len(lon)
    nlat = len(lat)
    ntime = 240      # Mude aqui - Qtd de passos de tempo do arquivo de saída
    nmon = ntime/20  # Mude aqui - Qtd de anos do arquivo de saída
    nyear = ntime/12 # Mude aqui - Qtd de meses do arquivo de saída

    tri = ('JFM', 'FMA', 'MAM', 'AMJ', 'MJJ', 'JJA', 'JAS', 'ASO', 'SON', 'OND', 'NDJ', 'DJF')
    ini = ('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12')

    aux = np.zeros((ntime, nlat, nlon)) * -999

    # Separa os trimestres JFM, FMA, MAM...
    for k in range(0, ntime):
        aux[k, :, :] = np.ma.sum(var[k:3+k, :, :], axis=0)

    # Define que onde for NaN substitua por -999
    dummy = np.where(np.isnan(aux), -999, aux)

    # a = dummy.reshape(nmon,nyear,nlat,nlon) # 1989: JFM, FMA, MAM...

    a = dummy.reshape(nyear, nmon, nlat, nlon)  # 1989: JFM, 1990: JFM...

    # ESCREVE NETCDF
    for k in range(0, nmon):
        fname = output_name[i]+'.{0}.nc'.format(tri[k])
        create_netcdf(a[:, k, :, :], lat, lon, fileout=fname, ntime=20, fillvalue=-999, varname='prec', varunits='mm', varlongname='monthly mean precipitation')