Page tree
Skip to end of metadata
Go to start of metadata

Question

I am trying to download data ECMWF Public Datasets , but

  • using the Public Datasets web interface I get an error "Bad Request (400)"
  • Using the WebAPI I get an error "mars - ERROR  - YYYYMMDD.HHMMSS - Error code is -2", and the output file size is 0

 

Affected datasets

ERA-20C, Monthly Means of Daily Means

CERA-20C, Monthly Means of Daily Means

potentially other datasets

 

Answer

This can happen if you request data for many individual dates, or monthly data over a very long time period. For example, you select Monthly Means data for the time period Jan/1900 to Dec/2000. Monthly means data is timestamped to the first of each month, so the query string becomes :

"date": "19000101/19000201/19000301/19000401/19000501/ ...  /20001201/",

This string is becoming too long to be processed.


Workaround

Please retrieve shorter time periods. For monthly data we recommend one retrieval per decade, for example with the WebAPI for ERA-20C:

#!/usr/bin/env python
from ecmwfapi import ECMWFDataServer
server = ECMWFDataServer()
server.retrieve({
"class": "e2",
    "dataset": "era20c",
    "date": "19000101/19000201/19000301/19000401/19000501/19000601/19000701/19000801/19000901/19001001/19001101/19001201/19010101/19010201/19010301/19010401/19010501/19010601/19010701/19010801/19010901/19011001/19011101/19011201/19020101/19020201/19020301/19020401/19020501/19020601/19020701/19020801/19020901/19021001/19021101/19021201/19030101/19030201/19030301/19030401/19030501/19030601/19030701/19030801/19030901/19031001/19031101/19031201/19040101/19040201/19040301/19040401/19040501/19040601/19040701/19040801/19040901/19041001/19041101/19041201/19050101/19050201/19050301/19050401/19050501/19050601/19050701/19050801/19050901/19051001/19051101/19051201/19060101/19060201/19060301/19060401/19060501/19060601/19060701/19060801/19060901/19061001/19061101/19061201/19070101/19070201/19070301/19070401/19070501/19070601/19070701/19070801/19070901/19071001/19071101/19071201/19080101/19080201/19080301/19080401/19080501/19080601/19080701/19080801/19080901/19081001/19081101/19081201/19090101/19090201/19090301/19090401/19090501/19090601/19090701/19090801/19090901/19091001/19091101/19091201",
    "expver": "1",
    "levelist": "800/900/1000",
    "levtype": "pl",
    "param": "u/v",   # See for parameter names and codes: http://apps.ecmwf.int/codes/grib/param-db
    "stream": "moda",
    "type": "an",
    "area": "60/-10/30/50",
    "grid": "2/2",
    "format": "netcdf",
    "target": "u_v_pl_19000101_to_19091201.grib",
})

 

For further examples please see ERA-20C retrieval efficiency