- 积分
- 7755
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2020-7-9
- 最后登录
- 1970-1-1
|
发表于 2022-7-22 16:30:30
|
显示全部楼层
import calendar
from ecmwfapi import ECMWFDataServer
server = ECMWFDataServer()
yearStart = 1979 # adjust to your requirements - as of 2017-07 only 2010-01-01 onwards is available
yearEnd = 2019 # adjust to your requirements
months1 = [1,2,3,4,5,6,7,8,9,10,11,12] # adjust to your requirements
months2 = [1,2,3,4,5,6,7,8] # adjust to your requirements
years = range(yearStart, yearEnd+1)
requestDates=" "
for y in years:
if y <= 2018:
for m in months1:
requestDates = requestDates+str(y)+(str(m)).zfill(2)+'01/'
else:
for m in months2:
requestDates = requestDates+str(y)+(str(m)).zfill(2)+'01/'
requestDates = requestDates[:-1]
server.retrieve({
"class": "ei",
"dataset": "interim",
"date":requestDates,
"expver": "1",
"grid": "0.75/0.75",
"levtype": "sfc",
"param": "167.128",
"step": "0",
"stream": "mnth",
"time": "00:00:00/06:00:00/12:00:00/18:00:00",
"type": "an",
"format":"netcdf",
"target": "197901-201908_month_t2m.nc",
})
|
|