Python script: Surface variables

On a Gaussian grid (N128).

#!/usr/bin/env python
from ecmwfapi import ECMWFDataServer
import calendar

server = ECMWFDataServer()

for year in range(1979, 2005):
 print 'YEAR ',year
 for month in range(01,13):
  lastday1=calendar.monthrange(year,month)
  lastday=lastday1[1]
  bdate="%s%02d01"%(year,month)
  edate="%s%02d%s"%(year,month,lastday)
  print "######### ERA-interim  #########"
  print 'get data from ', bdate,' to ',edate,' (YYYYMMDD)'
  print "################################"
  server.retrieve({

    'stream'   : "oper",
    'dataset'  : "interim",
    'date'     : "%s/to/%s"%(bdate,edate),
    'time'     : "00/06/12/18",
    'step'     : "0",
    'levtype'  : "sfc",
    'type'     : "an",
    'class'    : "ei",
    'grid'     : "128",
    'param'    : "165/166/167/168/134/151/235/31/34/33/141/139/170/183/236/39/40/41/42",
    'target'   : "ERA-Int_sfc_%s_%s.grb"%(bdate,edate),
    })

Each file will have a size between 500 and 600MB.