import cdsapi

c = cdsapi.Client()

for format_file in ['grib','netcdf']:
    if format_file == 'grib':
        extension = '.grib'
    else:
        extension = '.nc'
    
    filename = '../archives/reanalysis/30_reanalysis-uerra-europe-pressure-levels' + extension

    c.retrieve(
        'reanalysis-uerra-europe-pressure-levels',
        {
            'format':format_file,
            'year':'2000',
            'month':'01',
            'day':'01',
            'time':'06:00',
            'variable':['u_component_of_wind','geopotential'],
            'pressure_level':[
                '10','500'
            ]
        },
        filename)
