Hello Yang,
I want to download the " [Mean temperature tendency due to short-wave radiation" and the “Mean temperature tendency due to long-wave radiation” in Table 13, and my codes are as follows:
import cdsapi
c = cdsapi.Client()
yearStart = 1979 # adjust to your requirements
yearEnd = 2022 # adjust to your requirements
years = range(yearStart, yearEnd+1)
for y in years:
target = ‘/mnt/nas/ERA5/monthly/1x1/LWHR/lwhr.’+str(y)+‘.1x1.grib’
#target = ‘/mnt/nas/ERA5/monthly/packed/T.’+str(y)+‘.0.25x0.25.v5.1.nc’ # specifies the output file name
print(target)
year = str(y)
date = year + ‘-01-01/’ + year + ‘-12-01’
print(date)
c.retrieve(
‘reanalysis-era5-complete’, #‘reanalysis-era5.1-pressure-levels-monthly-means’
{
“year”: year,
“levtype”: “ml”,
‘format’: ‘grib’,
“param”: “235002”,
“stream”: “moda”,
“type”: “fc”,
“date”: date,
# ‘grid’: ‘1.0/1.0’
},
target)
but there are some wrong information :
2024-07-03 21:28:29,625 INFO Welcome to the CDS
2024-07-03 21:28:29,625 INFO Sending request to https://cds.climate.copernicus.eu/api/v2/resources/reanalysis-era5-complete
2024-07-03 21:28:29,847 INFO Request is queued
2024-07-03 21:28:38,753 INFO Request is failed
2024-07-03 21:28:38,753 ERROR Message: an internal error occurred processing your request
2024-07-03 21:28:38,753 ERROR Reason: mars - ERROR - 20240703.132835 - Mars server task finished in error
mars - ERROR - 20240703.132835 - AccessError: Restricted access to ERA5T. Please, check that your date selection is valid. For more information, visit Climate reanalysis | Copernicus [cdsfdb]
mars - ERROR - 20240703.132835 - Error code is -2
mars - ERROR - 20240703.132835 - Multibase error -2
mars - ERROR - 20240703.132835 - Request failed
mars - ERROR - 20240703.132835 - Some errors reported (last error -2)
2024-07-03 21:28:38,753 ERROR Traceback (most recent call last):
2024-07-03 21:28:38,753 ERROR File “/opt/cdstoolbox/cdscompute/cdscompute/cdshandlers/services/handler.py”, line 59, in handle_request
2024-07-03 21:28:38,753 ERROR result = cached(context.method, proc, context, context.args, context.kwargs)
2024-07-03 21:28:38,753 ERROR File “/opt/cdstoolbox/cdscompute/cdscompute/caching.py”, line 108, in cached
2024-07-03 21:28:38,753 ERROR result = proc(context, *context.args, **context.kwargs)
2024-07-03 21:28:38,753 ERROR File “/opt/cdstoolbox/cdscompute/cdscompute/services.py”, line 124, in call
2024-07-03 21:28:38,753 ERROR return p(*args, **kwargs)
2024-07-03 21:28:38,753 ERROR File “/opt/cdstoolbox/cdscompute/cdscompute/services.py”, line 60, in call
2024-07-03 21:28:38,753 ERROR return self.proc(context, *args, **kwargs)
2024-07-03 21:28:38,753 ERROR File “/home/cds/cdsservices/services/mars/mars.py”, line 53, in external
2024-07-03 21:28:38,753 ERROR return mars(context, request, **kwargs)
2024-07-03 21:28:38,753 ERROR File “/home/cds/cdsservices/services/mars/mars.py”, line 20, in mars
2024-07-03 21:28:38,753 ERROR execute_mars(context, requests, info)
2024-07-03 21:28:38,753 ERROR File “/home/cds/cdsservices/services/mars/execute_mars.py”, line 74, in execute_mars
2024-07-03 21:28:38,753 ERROR raise Exception(error_lines)
2024-07-03 21:28:38,754 ERROR Exception: mars - ERROR - 20240703.132835 - Mars server task finished in error
2024-07-03 21:28:38,754 ERROR mars - ERROR - 20240703.132835 - AccessError: Restricted access to ERA5T. Please, check that your date selection is valid. For more information, visit Climate reanalysis | Copernicus [cdsfdb]
2024-07-03 21:28:38,754 ERROR mars - ERROR - 20240703.132835 - Error code is -2
2024-07-03 21:28:38,754 ERROR mars - ERROR - 20240703.132835 - Multibase error -2
2024-07-03 21:28:38,754 ERROR mars - ERROR - 20240703.132835 - Request failed
2024-07-03 21:28:38,754 ERROR mars - ERROR - 20240703.132835 - Some errors reported (last error -2)
Traceback (most recent call last):
File “ERA5-monthly-longwave_heatingrate01.py”, line 33, in
target)
File “/home1/xuxr/.local/lib/python3.7/site-packages/cdsapi/api.py”, line 364, in retrieve
result = self._api(“%s/resources/%s” % (self.url, name), request, “POST”)
File “/home1/xuxr/.local/lib/python3.7/site-packages/cdsapi/api.py”, line 521, in _api
% (reply[“error”].get(“message”), reply[“error”].get(“reason”))
Exception: an internal error occurred processing your request. mars - ERROR - 20240703.132835 - Mars server task finished in error
mars - ERROR - 20240703.132835 - AccessError: Restricted access to ERA5T. Please, check that your date selection is valid. For more information, visit Climate reanalysis | Copernicus [cdsfdb]
mars - ERROR - 20240703.132835 - Error code is -2
mars - ERROR - 20240703.132835 - Multibase error -2
mars - ERROR - 20240703.132835 - Request failed
mars - ERROR - 20240703.132835 - Some errors reported (last error -2).
Could you give me some help please? Thank you very much!