#!/bin/sh # # # 01get_TIGGE_dat.sh # # Mio MATSUEDA (University of Tsukuba and University of Oxford) # # Modified on 12th October, 2011 # Revised on 19th July, 2012 # Revised on 20th August, 2015 # ############################## (Initial settings) ############################## # # Before you execute this program, you may need to do the following: # (Please also see https://software.ecmwf.int/wiki/display/WEBAPI/Accessing+ECMWF+data+servers+in+batch) # # 1. Visit ECMWF's TIGGE portal: http://apps.ecmwf.int/datasets/data/tigge # # 2. Click "login" in "Please login before retrieving data from this dataserver" to do a user registration # # 3. After you login https://apps.ecmwf.int/auth/login/, please retrieve your key at https://api.ecmwf.int/v1/key/ # # 4. Copy the information in this page and paste it in the file $HOME/.ecmwfapirc # # -------------------- ($HOME/.ecmwfapirc) -------------------- # { # "url" : "https://api.ecmwf.int/v1", # "key" : "XXXXXXXXXXXXXXXXXXXXXX", # "email" : "john.smith@example.com" # } # -------------------- ($HOME/.ecmwfapirc) -------------------- # # ############################## (Data retrieval) ############################## # # TIGGE data can be accessed in a 2-day delay mode. # See the following sites for more details: # https://software.ecmwf.int/wiki/display/TIGGE/Models # http://gpvjma.ccs.hpcc.jp/TIGGE/data_details.pdf # # set centre, variable, nitial date of forecast, forecast step, and grid spacing # e.g. # centre: ALL, BOM, CMA, CMC, CPTEC, ECMWF, JMA, KMA, NCEP, UKMO # var: U200, V200, T850, Q850, Z500, U10m, V10m, T2m, Td2m PMSL, PRCP # (1000, 925, 850, 700, 500, 300, 250, and 200hPa and surface are available) # ############ Edit here!!! ############ centre=ECMWF ; var=Z500 ; yy=2015 ; mm=08 ; dd=01 ; hh=12 ymd=${yy}${mm}${dd} ; ymdh=${yy}${mm}${dd}${hh} step="0/to/360/by/12" #step="0/24/48/72/96/120/144/168/192/216/240/264/288/312/336/360" grid="5.0/5.0" ############ Edit here!!! ############ # # Variables' abbreviations # # pressure level single level # u: U velocity 10u: U velocity at 10m # v: V velocity 10v: V velocity at 10m # t: temperature 2t: temperature at 2m # q: specific humidity 2d: dew point temperature at 2m # gh: geopotential msl: sea level pressure # sp: surface pressure # tp: total precipitation # # See the following site for details: # https://software.ecmwf.int/wiki/display/TIGGE/Parameters # case ${var} in U??0 ) param=u ; levtype=pl ; plev=`echo ${var} | cut -c2-4` ;; V??0 ) param=v ; levtype=pl ; plev=`echo ${var} | cut -c2-4` ;; T??0 ) param=t ; levtype=pl ; plev=`echo ${var} | cut -c2-4` ;; Q??0 ) param=q ; levtype=pl ; plev=`echo ${var} | cut -c2-4` ;; Z??0 ) param=gh ; levtype=pl ; plev=`echo ${var} | cut -c2-4` ;; U1000 ) param=u ; levtype=pl ; plev=1000 ;; V1000 ) param=v ; levtype=pl ; plev=1000 ;; T1000 ) param=t ; levtype=pl ; plev=1000 ;; Q1000 ) param=q ; levtype=pl ; plev=1000 ;; Z1000 ) param=gh ; levtype=pl ; plev=1000 ;; U10m ) param=10u ; levtype=sl ; plev=1000 ;; V10m ) param=10v ; levtype=sl ; plev=1000 ;; T2m ) param=2t ; levtype=sl ; plev=1000 ;; Td2m ) param=2d ; levtype=sl ; plev=1000 ;; PMSL ) param=msl ; levtype=sl ; plev=1000 ;; PS ) param=sp ; levtype=sl ; plev=1000 ;; PRCP ) param=tp ; levtype=sl ; plev=1000 ;; esac # case ${centre} in ALL ) centre2=all ;; BOM ) centre2=ammc ;; CMA ) centre2=babj ;; CMC ) centre2=cwao ;; CPTEC ) centre2=sbsj ;; ECMWF ) centre2=ecmf ;; JMA ) centre2=rjtd ;; KMA ) centre2=rksl ;; METFR ) centre2=lfpw ;; NCEP ) centre2=kwbc ;; UKMO ) centre2=egrr ;; esac # echo ------------- Data request: ${var} ${centre} CNTL and PRTB ${ymdh} ------------- # for type in cf pf do case ${type} in cf ) type2=CNTL ;; pf ) type2=PRTB ;; esac # ODIR=./data if [ ! -d ${ODIR} ] ; then mkdir -p ${ODIR} ; fi ofile=${ODIR}/${var}_${centre}_${type2}_i${ymdh}.grib2 # cat > get_daily.py << EOF #!/usr/bin/env python from ecmwfapi import ECMWFDataServer server = ECMWFDataServer() server.retrieve({ 'dataset' : "tigge", 'expver' : "prod", 'origin' : "${centre2}", # NWP centre (e.g. all, ecmf, or cwao/ecmf/kwbc/eggr) 'type' : "${type}", # control(cf) or perturbed(pf) forecasts 'number' : "all", # Ensemble member 'param' : "${param}", # Meteorological variable (e.g. gh or gh/t) 'date' : "${ymd}", # Initial YYYYMMDD (e.g. 20110313 or 20110313/to/20110526) 'time' : "${hh}", # Initial UTC (e.g. 00 or 00/12) 'step' : "${step}", # Forecast interval (e.g. 0/to/216/by/24) 'area' : "90/0/-90/360", # Region (North/West/South/East) 'grid' : "${grid}", # Grid interval (e.g. 5.0/5.0) 'levtype' : "${levtype}", # Pressure level(pl) or single level(sl) 'levelist': "${plev}", # Pressure level(hPa, e.g. 500 or 500/850) 'target' : "${ofile}" # File name }) EOF # chmod a+x ./get_daily.py ./get_daily.py rm -rf get_daily.py # echo done # type # exit