Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagepy
#!/usr/bin/env python
from ecmwfapi import ECMWFDataServer
modelVersionDate = "2014-05-01"  # This is the first model version for CMA (babj)
hindcastDate = "2014-04-01"      # The selected hindcast date
server = ECMWFDataServer()
server.retrieve({
    "class": "s2",
    "dataset": "s2s",
    "date": modelVersionDate,
    "expver": "prod",
    "hdate": hindcastDate, 
    "levtype": "sfc",
    "origin": "babj",
    "param": "165/166",
    "step": "24/to/1440/by/24",
    "stream": "enfh",
    "target": "data.pf.sfc",
    "time": "00",
    "number": "1/2/3",
    "type": "pf",
})

A CMA reforecast request for

...

all the available hindcastDates

Info
  • The objective of this example is to demonstrate how you can write a request efficiently by iterating properly over several hindcastYears, hindcastMonths and hindcastDays
  • It can be used as a starting point however you need to adapt it to your needseg to set the keyword values according to your requirements (eg hindcastYear).
  • In this way you can extend this request to download the whole S2S CMA reforecast. Don't forget to check CMA availability (warning)

(warning) Please note:

  • use the variable "target"  to write each hindcastDate on a separate file .
  • taking under consideration your request's size (eg nr of fields and volume)  you can merge several hindcastDates on the same "target" (smile)

...