Versions Compared

Key

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

...

Info

In general it is organised, as a huge tree, with the indentation below, showing different levels down that tree

  • stream: Synoptic monthly means for ensembles (edmm)
    • type of data: Analysis (an)Year: 1901
      • type of level: Model levels (ml)

        • all months of a year, times, levels, parameters and ensemble members (same tape file)
    • type of level: Potential temperature (pt)
      • all months of a year, times, levels, parameters and ensemble members (same tape file)
    • type of level: Potential vorticity (pv)

      • all months of a year, times, levels, parameters and ensemble members (same tape file)

    • type of level: Pressure level (pl)

      all months of a year, times, Decade: 1900
      • all years of a decade, months, times, types (an/fc), level types, levels, parameters and ensemble members (same tape file)
      • type of level: Surface (sfc)

        • all months of a year, times, parameters and ensemble members (same tape file)
      • Year: 1902
    • Decade: 1910
      • ...Year
    • Decade: ...
         
      • ...
        Year
    • Decade: 2010
      • ...
    • type of data: Forecast (fc) 

      • Year: 1901

        • type of level: Model levels (ml)

          • all months of a year, times, steps, levels, parameters and ensemble members (same tape file)
        • type of level: Pressure levels (pl)

          • all months of a year, times, steps, levels, parameters and ensemble members (same tape file)

        • type of level: Surface (sfc)

          • all months of a year, times, steps, parameters and ensemble members (same tape file)

      • Year: 1902
        • ...
      • Year: ...
        • ...
      • Year: 2010
        • ...

What would be the natural way to group requests?

Info

The idea is to request as much data as possible from the same tape file.  In general the most efficient  way to group requests would be per level type . ie decade, i.e. put all years, months, times, types, level types, levels, desired parameters and ensemble members for a specific combination of level type, year, and type of datadecade in one request.

Examples

Info
  • The objective of the examples below is to demonstrate how to iterate efficiently for a particular CERA-20C request.
  • At this point you may wish to have a look on the  CERA-20C synoptic monthly means availability and identify your desired level type, data type, time periods, parameters, etc.
  • The requests below can be used as a starting point, however, you will need to adapt them to your requirements, for example change some values (the right side of the "key":"value" pairs) or add or remove some keys.

Requesting analysis (an) surface (sfc) data over multiple years

In the data tree 'type of datadecade' is highest, followed by 'year', followed by 'type of level'. So we keep within one 'type of data' (an), go into the first year, get the relevant surface level data for all 12 months, . Getting data for the whole decade in one go might exceed data volume limitations though, so we split our request by years: we get all data we need for the first year, then move on to the next year, and so on.

Code Block
languagepy
#!/usr/bin/env python
from ecmwfapi import ECMWFDataServer
server = ECMWFDataServer()

def retrieve_cera20c_edmm():
    """
       A function to demonstrate how to iterate efficiently over all months,
       for a list of years, for a CERA-20C synoptic monthly means request. 
       You can extend the number of years to adapt the iteration to your needs.
       You can use the variable 'target' to organise the requested data in files as you wish."        
    """
    yearStart = 2000
    yearEnd = 2003
    monthStart = 1
    monthEnd = 12

    # edmm is arranged by years, so we iterate over the years
    for year in list(range(yearStart, yearEnd + 1)):
        requestMonthList = []
        for month in list(range(monthStart, monthEnd + 1)):
            requestMonthList.append('%04d-%02d-01' % (year, month))
        requestMonths = "/".join(requestMonthList)
        # we submit a data request for the current year
        target = "cera20c_edmm_an_%s_sfc.grb" % (year)
        era20c_edmm_sfc_request(requestMonths, target)

def era20c_edmm_sfc_request(requestMonths, target):
    """      
        A CERA-20C request for analysis, sfc data.
        You can change the keywords below to adapt it to your needs.
        (eg add or remove  parameters, times etc)
    """
    server.retrieve({
        "class": "ep",
        "dataset": "cera20c",
        "stream": "edmm",
        "expver": "1",
        "type": "an",
        "levtype": "sfc",
        "date": requestMonths,
        "param": "165.128/166.128/167.128/168.128",
        "target": target,
        "time": "00/06/12/18"
    })

if __name__ == '__main__':
    retrieve_cera20c_edmm()