从ERA-Interim下载降雪和地表降水数据时出错

时间:2018-08-24 18:28:46

标签: download netcdf

我正在使用python脚本从ERA-Interim重新分析数据集中下载一些参数。除表面降雪和总降水量外,它在所有其他参数下均能正常工作。它给出了错误

ecmwfapi.api.APIException:u'ecmwf.API错误1:错误6(MARS_EXPECTED_FIELDS):预期为62,得到0'

我检查了他们的网站,并且数据应该完全可用。我不是这里的问题。以下是用于下载降雪数据的脚本。请让我知道是否有任何问题。谢谢。

#!/usr/bin/env python
import calendar
from ecmwfapi import ECMWFDataServer
server = ECMWFDataServer()

def retrieve_interim():
    """
   A function to demonstrate how to iterate efficiently over several years and months etc
   for a particular interim_request.
   Change the variables below to adapt the iteration to your needs.
   You can use the variable 'target' to organise the requested data in files as you wish.
   In the example below the data are organised in files per month. (eg "interim_daily_201510.grb")
"""
yearStart = 1984
yearEnd = 1989
monthStart = 1
monthEnd = 12
startDate = '%04d%02d%02d' % (yearStart, monthStart, 1)
lastDate = '%04d%02d%02d' % (yearEnd, monthEnd, 31)
target = "sf_daily_%04dto%04d.nc" % (yearStart, yearEnd)
requestDates = (startDate + "/TO/" + lastDate)
interim_request(requestDates, target)

def interim_request(requestDates, target):
    """
    An ERA interim request for analysis pressure level data.
    Change the keywords below to adapt it to your needs.
    (eg to add or to remove  levels, parameters, times etc)
    Request cost per day is 112 fields, 14.2326 Mbytes
"""
server.retrieve({
    "class": "ei",
    "stream": "oper",
    "type": "an",
    "dataset": "interim",
    "date": requestDates,
    "expver": "1",
    "levtype": "sfc",
    #"levelist": "1000",
    "param": "sf",
    "target": target,
    "time": "00/12",
    "grid": "0.75/0.75",
    "format": "netcdf"
})
if __name__ == '__main__':
    retrieve_interim()

1 个答案:

答案 0 :(得分:2)

在ERA临时(http://apps.ecmwf.int/datasets/data/interim-full-daily/levtype=sfc/)中,降雪和降水只能作为预测产品使用,而不能作为分析产品使用。在上面的链接中,如果在步骤0上打勾,则会发现降水和降雪显示为灰色(表示不可用)。

另请参见https://www.ecmwf.int/sites/default/files/elibrary/2011/8174-era-interim-archive-version-20.pdf中的表9。降水和降雪从每次天气预报开始就开始累积。我建议您转到第一个网站,单击一个月的降水和降雪,单击view MARS request,然后获得一个模板,显示火星请求的外观。

enter image description here