Below you can find some simple Python scripts making use of the ecmwfapi library for era20c dataset:

ERA-20c daily forecast sfc

 #!/usr/bin/env python
from ecmwfapi import ECMWFDataServer
 
server = ECMWFDataServer()
 
server.retrieve({
     'dataset' : 'era20c',
     'stream'  : 'oper',
     'levtype' : 'sfc',
     'param'   : '165.128',
     'date'    : '20091201/TO/20101201',
     'type'    : 'fc',
     'time'    : '06',
     'step'    : '06',
     'area'    : "70/-130/30/-60",
     'grid'    : "2/2",
     'target'  : "data.grib"
    })

ERA-20c daily analysis pl

 #!/usr/bin/env python
from ecmwfapi import ECMWFDataServer
 
server = ECMWFDataServer()
 
server.retrieve({
     'dataset'  : 'era20c',
     'stream'   : 'oper',
     'levtype'  : 'pl',
     'levelist' : '975/1000',
     'param'    : '131.128/132.128',
     'date'     : '19000101/to/19000210',
     'type'     : 'an',
     'time'     : '06',
     'target'   : 'era20c_daily_an_pl.grib'
    })

ERA-20c daily analysis pv

 #!/usr/bin/env python
from ecmwfapi import ECMWFDataServer
 
server = ECMWFDataServer()
 
server.retrieve({
     'dataset'  : 'era20c',
     'stream'   : 'oper',
     'levtype'  : 'pv',
     'levelist' : '2000',
     'param'    : '129.128/131.128/132.128',
     'date'     : '19200405/to/19200406',
     'type'     : 'an',
     'time'     : '06',
     'target'   : 'era20c_daily_an_pv.grib'
    })

ERA-20c daily invariant

 #!/usr/bin/env python
from ecmwfapi import ECMWFDataServer
 
server = ECMWFDataServer()
 
server.retrieve({
     'dataset'  : 'era20c',
     'stream'   : 'oper',
     'levtype'  : 'sfc',
     'param'    : '129.128/160.128/161.128/162.128/163.128/172.128/173.128/234.128/27.128/28.128/29.128/30.128/43.128/74.128',
     'date'     : '19000101',
     'target'   : 'era20c_daily_invariant.grib'
    })

ERA-20c ocean wave fc

 #!/usr/bin/env python
from ecmwfapi import ECMWFDataServer
 
server = ECMWFDataServer()
 
server.retrieve({
     'dataset' : 'era20c',
     'stream'  : 'wave',
     'param'   : '244.140/249.140',
     'date'    : '1954-02-01/to/1954-04-30',
     'type'    : 'fc',
     'time'    : '06',
     'step'    : '03/09',
     'target'  : 'era20c_daily_wave_fc.grib'
    })

3 Comments

  1. I wonder if it's possible to download monly means of daily means data by the python scirpt?

    Does it has to be downloaded via the website?

    Looking forward to your suggestions.

    Thanks

    1. Unknown User (uscs)

      Dear Yanyan,

      Yes, you can download monthly means of daily means using the Python scripts. Remember that you can use the web browser to discover the available data and then use "View MARS request" button to obtain the Python script.

      If you select the month and the parameters in the following web page and then click the "View MARS request" at the bottom of the page, you will be able to see the Python script that you have to use:

      http://apps.ecmwf.int/datasets/data/era20c-moda/levtype=sfc/type=an/

      Example: ERA 20C monthly means of daily means for December 2010 2m temperature:

      #!/usr/bin/env python
      from ecmwfapi import ECMWFDataServer
      server = ECMWFDataServer()
      server.retrieve({
          "class": "e2",
          "dataset": "era20c",
          "date": "20101101",
          "expver": "1",
          "levtype": "sfc",
          "param": "167.128",
          "stream": "moda",
          "type": "an",
          "target": "CHANGEME",
      })

      Best regards,

      Cristian

      1. Unknown User (uskh)

        By the way, you can get the ERA-20C Monthly Means of Daily Means not only on surface level as shown on http://apps.ecmwf.int/datasets/data/era20c-moda/levtype=sfc/type=an/, but also on pressure level, as below.

        #!/usr/bin/env python
        from ecmwfapi import ECMWFDataServer
        server = ECMWFDataServer()
        server.retrieve({
          "class": "e2",
          "dataset": "era20c",
          "date": "20000101/20000201/20000301",     # For monthly data use the first of of month as date
          "expver": "1",
          "levelist": "1/2/3/5/7/10/20/30/50/70/100/125/150/175/200/225/250/300/350/400/450/500/550/600/650/700/750/775/800/825/850/875/900/925/950/975/1000",
          "levtype": "pl",
          "param": "z/q/r/u/v",
          "stream": "moda",
          "type": "an",
          #"grid": "2/2",      # Explicitly specify an output grid, for example for a 2 degree lat/lon grid:  "grid": "2/2".
          #"format": "netcdf",    # Get output in NetCDF instead of GRIB. When using "format":"NetCDF" you also have to specify a lat/lon grid as above.
          "target": "CHANGEME",
        })