...
Code Block | ||
---|---|---|
| ||
mars < myrequestfile # or mars myrequestfile |
Table of Contents
Basic MARS usage
Simple retrieves
1)
Retrieve 1000,850,700 and 500 hPa temperatures from the 15th of October 2023 12 UTC Analysis > see in MARS Catalogue
...
Code Block | ||
---|---|---|
| ||
module load ecmwf-toolbox grib_ls t.grb |
How many messages messages does the GRIB file containscontain? Does it match to the number of expected fields retrieved from MARS?
Expand | ||
---|---|---|
| ||
grib_ls t.grb t.grb edition centre typeOfLevel level dataDate stepRange dataType shortName packingType gridType gridType 4 of 4 messages in t.grb |
...
Retrieve European domain on the same latitude-longlitude longitude grid as in the previous retrieval. Compare the size of the resulting file with the previous one. > see in MARS Catalogue
...
Expand | ||
---|---|---|
| ||
module load ecmwf-toolbox grib_ls t.gg.grb t.gg.grb edition centre typeOfLevel level dataDate stepRange dataType shortName packingType gridType 1 ecmf isobaricInhPa 1000 20231025 48 fc t grid_simple reduced_gg grib_ls t.ll.grb t.ll.grb edition centre typeOfLevel level dataDate stepRange dataType shortName packingType gridType 1 ecmf isobaricInhPa 1000 20231025 48 fc t grid_simple regular_ll |
...
With grib_dump you will see that the area in 10u_10v.grb and previously downloaded file from European area: t.ll.europe.grb are not identical.
Advanced MARS usage
Multi-target
Ensemble forecasts
1)
Retrieve the 2 metre temperature and 2 metre dew point temperature field fields of the first 10 members of a week old 12 UTC ensemble prediction (type: perturbed forecast) for 2, 3 and 4 days in advance > see in MARS Catalogue
Expand | ||
---|---|---|
| ||
retrieve, |
...
Expand | ||
---|---|---|
| ||
retrieve, |
Note that this time we user used the MARS keyword "type" and the ecCodes key "shortName" in the name of the target file. Add one more parameter "param" (find in MARS catalogue link which parameters are available) to the second request and re-run it again. How many target files did the request requests create?
Expand | ||
---|---|---|
| ||
2 target files |
Advanced MARS usage
Efficiency
In one of previous' requests output find a line looking like this:
...
Expand | ||
---|---|---|
| ||
number_of_tapes=11; |
If you need to download this data for entire January 2020, how would you proceed:
- Running one request for entire month (pros / cons)
- Running 31 daily requests (pros / cons)
?
Read, Write, Compute
Retrieve U and V wind components at 10 metre from 10 day old analysis and calculate wind speed > see in MARS catalogue
Code Block | ||
---|---|---|
| ||
retrieve, class = od, expver = 1, stream = oper, type = analysis, date = -10, time = 12, levtype = sfc, param = 165.128, # u grid = 1/1, fieldset = u retrieve, param = 166.128, # v fieldset = v compute, formula = "sqrt(u*u + v*v)", fieldset = speed write, fieldset = speed, target = "$SCRATCH/windspeed"windspeed" |
Additional exercise (question from Nikolaos):
This request will read previously created GRIB file, crop the European area from global domain and save it as another GRIB file:
Code Block | ||
---|---|---|
| ||
read,
source = "windspeed",
grid = 1/1,
area = europe,
target = "europe_windspeed" |
To convert previously created GRIB file to netCDF using ecCodes in a terminal on the ECS or HPC:
Code Block | ||
---|---|---|
| ||
>module load ecmwf-toolbox
>grib_to_netcdf -o windspeed.nc windspeed
grib_to_netcdf: Version 2.30.2
grib_to_netcdf: Processing input file 'windspeed'.
grib_to_netcdf: Found 1 GRIB field in 2 files.
grib_to_netcdf: Ignoring key(s): method, type, stream, refdate, hdate
grib_to_netcdf: Creating netCDF file 'windspeed.nc'
grib_to_netcdf: NetCDF library version: 4.9.1 of Feb 9 2023 13:54:09 $
grib_to_netcdf: Creating large (64 bit) file format.
grib_to_netcdf: Defining variable 'u10'.
grib_to_netcdf: Done.
|