Hello guys!
I am now coming across an elusive problem when downloading the 'reanalysis-era5-complete' dataset through the CDS API python code. The parameter I want to download is mean temperature tendency due to long-wave radiation (paramID=235002), which is not accessible on the CDS disk. Due to the large volume of daily data I need, I have used the loop statement to download only one month of daily data for one single request according to the efficiency tips, as shown in the python code below. Notwithstanding the slow speed, the data got successfully retrieved in the beginning. But when downloading the data with the date of '1982-03-01/to/1982-03-31', the request is failed after running for a while for the first time.
Then, I changed the value of the variable 'first_year' into 1983, trying to download data after the year of 1983. This time, the first six months of daily data can be downloaded successfully, then it failed with the date of '1983-07-01/to/1983-07-31'. And I repeated the above-mentioned processes several times, error message always emerged after some successful accesses. The content of error messages is either "the request you have submitted is not valid" or "an internal error occurred processing your request" with a 'permission denied: /cache/tmp' reason.
So, I am very confused why errors would appear even using the very identical python code, which has been successfully used to download data previously. Is it related to the cache issue in this post? Or is there any problem with my python code (I am also expecting any advice to download in a faster way)? Or, the parameter I download is missing on some specific dates in the ERA5 archive, causing these errors?
Does anyone know what is wrong with it? Looking forward to any reply!
Kind regards,
JC Lee
#!/usr/bin/env python import cdsapifirst_year=1979
last_year=2020
nday=[31,28,31,30,31,30,31,31,30,31,30,31]for year in range(first_year, last_year+1):
for month in range(1,13):
# print(‘{year:04d}-{month:02d}-01/to/{year:04d}-{month:02d}-{nday:02d}’.format(year=year, month=month, nday=nday[month-1]))
print(“=============================================”)
print(“Downloading {year:04d}.{month:02d}”.format(year=year, month=month))c = cdsapi.Client() c.retrieve('reanalysis-era5-complete', { # Requests follow MARS syntax 'class': 'ea', 'date': '{year:04d}-{month:02d}-01/to/{year:04d}-{month:02d}-{nday:02d}'.format(year=year, month=month, nday=nday[month-1]), 'expver': '1', 'levelist': '14/18/20/24/26/29/36/41/48/54/60/65/68/71/74/77/79/83/87/90/93/96/98/101/103/106/108/109/111/113/115/116/119/121/125/129/136', 'levtype': 'ml', 'param': '235002', # mean tmp tendency due to long-wave radiation 'step': '0', 'stream': 'oper', 'time': '06:00:00/18:00:00', # or '06/18' 'type': 'fc', 'grid': '1.0/1.0', 'area': '90/-180/0/180', 'format': 'netcdf', }, "mttlwr.{year:04d}.{month:02d}.hourly.nc".format(year=year, month=month))</pre>