Versions Compared

Key

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

...

  • ML, 3 parameters
  • Time: 00 and 12,
  • Dates: 1 to 30 April 2017
  • first 90 steps, every hour (0/to/90/by/1)
  • 10 levels closer closest to the surface (127/to/137)
  • Area: Europe
  • Output grid: regular lat/lon 0.5/0.5

...

Using the MARS catalogue and the "View MARS request" functionality you can create a list request of all the data you want which would tell you can be created which can be used to find out the size and distribution of the raw data in the archive. Note the LIST verb and the OUTPUT = COST keyword.

...

When we run the list action this is the output, the following output is written to the file specified with the TARGET keyword (in this example, 'list.txt'):

No Format
size=591270399720;
number_of_fields=180180;
online_size=206846193282;
off_line_size=384424206438;
number_of_tape_files=60;
number_of_disk_files=546;
number_of_online_fields=63033;
number_of_offline_fields=117147;
number_of_tapes=8;
Warning

The data is too large: ~590 GB and split across 8 tapes.

Use the MARS catalogue to

...

find out how the data

...

are distributed in files and tapes

Using the MARS catalogue we , browse to the data we you want to get until we get to retrieve until you reach the final stage which gives us a selection and several options: http://apps.ecmwf.int/mars-catalogue/?class=od&stream=oper&expver=1&type=fc&year=2017&month=apr&levtype=ml&date=2017-04-01&time=00:00:00

For this particular case we can choose for 1 day, 1 time, , a different "Parameter", "Level" and "Step" . This means that all can be selected for a specific date and time. All the fields you can choose in this page are in stored on the same tape file. Therefore users You should get as much data as possible from this page in a single MARS retrieval request.

If we run the list of the data that we need and appears in the final stage page we get:

...

Tip

In this case the raw data (without post-processing) is ~9.85GB, which would be reduced .  The total size of the data to be transferred to your system will be less if you interpolate to lat/lon and/or filter the area.

The data is 1 stored on one single tape, which is sensible.

Tip

To know the The size of the file that will be transferred to the system , you can download 1 can be established by downloading a single field using the Post-processing keywords (usually GRID and AREA). Then you should multiply the size of the 1 file obtained containing this single field file by the total number of fields that you want to retrieve in 1 a single request: number_of_fields=3003.

...

Split the request in sensible chunks iterating through the correct keywords

Using the browser we know The browser can now be used to find out how the data is are distributed in the MARS tree. Now we focus Focussing on the "Current selection" section . In this casefor this specific example shows:

From the top to the bottom we have to start iterating from the inner loop to the outer loop "time", "date", ..etc.

This is an example BASH script to loop 1 time/ 1 day in one go for one monthretrieving data for one date and time at a time for a full month.

Code Block
languagebash
#!/bin/bash

#this# this example will filter the area of Europe (N/W/S/E) and interpolate the final fields to
# a 0.5x0.5 regular lat/-lon grid (GRID=0.5/0.5 degrees)
AREA="73.5/-27/33/45"
GRID="0.5/0.5"
PARAMS="130/131/132"
LEVELIST="127/128/129/130/131/132/133/134/135/136/137"
TIMES="0000 1200"
YEAR="2017"
MONTH="04"

#date loop
for y in ${YEAR}; do

  for m in ${MONTH}; do
    #get the number of days for this particular month/year
    days_per_month=$(cal ${m} ${y} | awk 'NF {DAYS = $NF}; END {print DAYS}')

    for my_date in $(seq -w 1 ${days_per_month}); do
      my_date=${YEAR}${MONTH}${my_date}

      #time lop
      for my_time in ${TIMES}; do
        cat << EOF > my_request_${my_date}_${my_time}.mars
REQUESTRETRIEVE,
    CLASS      = OD,
    TYPE       = FC,
    STREAM     = OPER,
    EXPVER     = 0001,
    LEVTYPE    = ML,
    GRID       = ${GRID},
    AREA       = ${AREA},
    LEVELIST   = ${LEVELIST},
    PARAM      = ${PARAMS},
    DATE       = ${my_date},
    TIME       = ${my_time},
    STEP       = 0/to/90/by/1,
    TARGET     = oper_ml_${my_date}_${my_time}.grib
EOF
      mars my_request_${my_date}_${my_time}.mars
      if [ $? -eq 0 ]; then
        rm -f my_request_${my_date}_${my_time}.mars
      fi
      done
    done
  done
done      

...