The visualization package is available in the casestudies directory of the OpenIFS cycle 40r1v2 release as well as in the ECMWF download server: http://download.ecmwf.int/test-data/openifs/reference_casestudies/programs/metview. Both contain the following folders and file:

Content of the visualization package

Folder or file

 

Description

macros

:

place of Metview visualization macros

definitions

:

place of some external functions and macros used by the macros

README.md

:

description about the content of the visualization package

Using the visualization package requires Metview 4.7.1, GRIB-API 1.18.0 or higher versions. Please make sure that the right programme versions are installed on your computer.

Using the Metview macros

The available Metview macros

Folder or file

 

Description

plot_IC.mv

:

Metview macro to visualize the initial conditions for 2 T255L91 experiments and the difference between them

plot_forecastrun.mv

:

Metview macro to visualize the results of forecast experiments

plot_ERAI_ERA5.mv

:

Metview macro to visualize the ERA-Interim or ERA5 data

dialog_plot_IC

:

Metview dialogue box (in macro language) to plot_IC.mv

dialog_plot_forecastrun

:

Metview dialogue box (in macro language) to plot_forecastrun.mv

dialog_plot_ERAI_ERA5

:

Metview dialogue box (in macro language) to plot_ERAI_ERA5.mv

help_plot_IC

:

help file to plot_IC.mv

help_plot_forecastrun

:

help file to plot_forecastrun.mv

help_plot_ERAI_ERA5

:

help file to plot_ERAI_ERA5.mv

scr_run_macros

:

shell script to execute the Metview macros

The visualization can be done by the Metview macros (*.mv files) in two ways: (1) interactively using a dialogue box or (2) in batch mode. Before using the macros, the path of the definitions directory has to be added to the METVIEW_MACRO_PATH (e.g., in .bashrc) to reach the external functions and colour definitions (for more details see below).


On this page


Useful links
  • Metview: installation, documentation, tutorials
  • GRIB-API: installation, documentation – discontinued
  • ecCodes: installation, documentation

(1) Interactive dialogue box

After opening Metview, with right mouse click on the macro icon and then selecting the Execute option from the menu, a dialogue box pops up showing the possible settings:

case study in dialog_plot_IC: Xaver (2013/12) or Desmond (2015/12);

experiment in dialog_plot_forecastrun: the 4-digit experiment ID number of forecast experiment;

reference in dialog_plot_ERAI_ERA5: ERA-Interim or ERA5;

surface parameters in dialog_plot_IC: 3 variables are available for visualisation, soil level temperature 2, surface pressure, (model) orography;

model level parameters in dialog_plot_IC: 4 variables are available for visualisation, temperature, wind, specific humidity, cloud cover;

model levels for model level variables: from 1 (uppest) to 91 (lowest);

surface parameters in dialog_plot_forecastrun and dialog_plot_ERAI_ERA5: 4 variables are available, 2-meter temperature, mean sea level pressure, precipitation, 10-meter wind gust;

pressure level parameters in dialog_plot_forecastrun and dialog_plot_ERAI_ERA5: 5 variables are available, temperature at 850 hPa, geopotential at 500 hPa, wind at 250 and 100 hPa, relative humidity at 700 hPa;

pressure levels for pressure level variables: 850, 700, 500, 250, 100 hPa;

Multiple variables (both surface and model/pressure level ones) can be selected at the same time. In case of choosing any model or pressure level parameters, selecting also (at least) one model or pressure level should not be forgotten (multiple options are possible also here).

Please note that to visualise different atmospheric variables on different levels (e.g., temperature at 850 hPa and humidity at 700 hPa), the macro has to be run separately with each setting.

experiment start date in dialog_plot_IC and dialog_plot_forecastrun: initial date of experiment in format yyyymmdd;

verification date in dialog_plot_forecastrun and dialog_plot_ERAI_ERA5: verification date in format yyyymmdd (20131204 or 20131205 for Xaver case, 20151204 or 20151205 for Desmond case, 20131206 and 20151206 are added to dialog_plot_ERAI_ERA5);

area can be selected with providing corners of a rectangle (the default is Europe with 25/-35/75/50 for S/W/N/E, respectively) and also using the mouse. Note that colour settings are prepared only for the default area, colours for any further region have to be fit manually;

input directory: location of the input files, closed with "/";

figure directory: location of the output figures, closed with "/".

(2) Batch mode

In batch mode the macro can be executed following the next syntax:

% metview -b macro option1 option2 option3 ...

where macro is the macro to be run (plot_IC.mv, plot_forecastrun.mv or plot_ERAI_ERA5.mv); option1, option2 etc. are the settings listed above. A detailed help together with some useful examples is provided with simple execution of the macro:

% metview -b macro

The shell script scr_run_macros executes the macros from the UNIX/Linux shell and it can be tailored for the own needs.

External functions and macros

The prepared Metview macros use some external functions, macros and colour definitions which are placed in the definitions directory.

The external functions located in definitions directory

File name               Description

build_layout_2plus1  : layout definition with 2 left panels and 1 right panel
build_layout_single  : layout definition a single panel

titlemain            : title style for the main plot
titlemain_2L         : 2-line title style for the main plot
titlepanels          : title style for the individual panels

legend_main          : legend definition for a single page
legend_shade         : legend definition for left panels
legend_diff          : legend definition for right panel (for the difference field)

base_visdef          : colour definitions for the different variables
diff_range           : dynamic colour definitions for the difference fields

To reach these functions and colour definitions, the path of the definitions directory has to be added to the METVIEW_MACRO_PATH (e.g., in .bashrc).

Please note that there is an include statement in the plot_forecastrun.mv and the plot_ERAI_ERA5.mv macros and further 2 ones in the plot_IC.mv, taking the two colour definitions (base_visdef and diff_range) from this directory. The path of the definitions directory has to be set in the downloaded macros according to the local working tree (it is necessary because using dynamic path with include is not possible in the macro language).

Input data

The input data are requested with the following content, format and name convention:

  • Macro plot_IC.mv expects the ICM* files as input: ICMGG${expID}INIT_${date}, ICMGG${expID}INIUA_${date}, ICMSH${expID}INIT_${date}, where
    expID is the 4-digit experiment ID;
    date is day in format yyyymmdd.
    The files have to be placed in the ${INPUTDIR}/${expID} folder, where INPUTDIR is the input directory specified when calling the macro.
  • Macros plot_forecastrun.mv expects grib files as input with the following file names: ${variable}_${date}.grib, where
    variable can be t2, mslp, p, gust, t850, q700, z500, u250, u100;
    date is day in format yyyymmdd.
    The files have to be placed in the ${INPUTDIR}/${expID} folder, where INPUTDIR is the input directory specified when calling the macro.
  • Macro plot_ERAI_ERA5.mv expects grib files as input with the following file names: ${referenceID}_${variable}_${period}.grib, where
    referenceID is ei for ERA-Interim and ea for ERA5;
    variable can be t2, mslp, p, gust, t850, q700, z500, u250, u100;
    period is the investigated time period in format of yyyymmdd-yyyymmdd (e.g., 20151201-20151206 for Desmond).
    The files have to be placed in the ${INPUTDIR}/reference folder, where INPUTDIR is the input directory specified when calling the macro.

Please note that the Metview macros expect only specifying ${INPUTDIR}/ as input directory without adding any further subdirectories (i.e, ${expID} or reference folders) into the command line.


Output figures

All the macros produce figures in single-page .ps files (see Figure 1) with the following file names:

  • plot_IC.mv: ${variable}_${level}_ERAI-ERA5_${date}+${timestep}.ps, where
    variable can be stl2, lnsp, z, t, cc, u, q;
    level can be 0 (in case of surface variables) or from 1 to 91;
    date
    is day in format yyyymmdd;
    timestep
    is forecast lead time in hours, e.g., 0, 3, 6 etc.
  • plot_forecastrun.mv: ${variable}_${level}_${expID}_${date}+${timestep}.ps, where
    variable can be t2, mslp, p, gust, t, q, z, u;
    level
    can be 0 (in case of surface variables) or 850, 700, 500, 250, 100;
    expID
    is the 4-digit experiment ID;
    date
    is day in format yyyymmdd;
    timestep
    is forecast lead time in hours in format hh, e.g., 00, 03, 06 etc.
  • plot_ERAI_ERA5.mv: ${variable}_${level}_${reference}_${date}${time}.ps, where
    variable can be t2, mslp, p, gust, t, q, z, u;
    level can be 0 (in case of surface variables) or 850, 700, 500, 250, 100;
    reference can be ERAI or ERA5;
    date is day in format yyyymmdd;
    time is hour in format (h)h, e.g., 0, 3, 6, 9, 12 etc.

The .ps files can be transformed in raster format, e.g., into .png files using the convert command. (Please note that convert requires the ImageMagick software to be installed.) Setting the resolution to 120 DPI generates sharp images with limited file size:

% convert -density 120 psfile pngfile

Running the Metview macros results in a large number of figures. To have an overview on them, based on the .png files a catalogue can be prepared which contains all relevant plots for the selected variable and a given investigation aspect (e.g., to study the impact of resolution changes in the forecast) in a concise format (click below and see Figure 2 for illustration). To quickly generate such an album, 2 possibilities are provided for the users: (1) the Macro functionality of Microsoft Office Word and (2) HTML templates.


Figure 1: Exemplary output figure. Here: 3-hourly 10-meter wind gust (m/s) at 00 UTC on 5 December 2015 from the T255L91 OpenIFS forecasts initialized from ERA-Interim at 00 UTC on 4 December 2015.

The provided Word macros (in MS Office 2013) create a table with figures for a given meteorological variable in each evaluation time step (i.e., in every 3 hours between 00 UTC 5 December and 00 UTC 6 December) from all the relevant case study.

  1. First of all, you need to copy the prepared Word Macros into the default template in your computer.
    1. Download the OpenIFS_WordMacros.dotm file (or in case of Word 97-2003 versions, the OpenIFS_WordMacros.dot file) from the ECMWF download server and open it.
    2. Make sure that the Developer tab is enabled for Word. To do this, go to File > Options > Customize Ribbon and in the right-hand panel, check the tick in the box labelled "Developer" and click "OK".
    3. Go to Developer > Document Template. At the bottom of the (first) "Templates" tab in the opening window, click on the "Organizer" button. In the "Organizer" window, click on the (second) "Macro Project Items" tab. One side already shows the content of the Normal.dotm (Normal.dot in Word 97-2003) template file, which is the default location for macros. On the other side of the window, drop down the list box labelled "Macro Project Items available in" and choose the OpenIFS_WordMacros.dotm (OpenIFS_WordMacros.dot) template file. Select the macro objects to copy from the OpenIFS_WordMacros.dotm (OpenIFS_WordMacros.dot) and click "Copy", then "Close". Now all macros you copied are available in your Normal.dotm (Normal.dot) and you can use them to create your own catalogue.
  2. Open a blank file in Word (File > New > Blank document).
  3. Go to View > Macros > View macros. You should see 8 new macros in the Normal.dotm (Normal.dot) template:

    There are 3 basic macros constructing the catalogues for comparison of the forecast results with different initial conditions (*_initialconditions), different resolutions (*_resolutions) and different starting dates (*_startdates). There are separate macros for the two case studies (*Desmond* and *Xaver*) regarding the different starting dates, because experiments for storm Desmond and storm Xaver were initialized from 5 and 3 different dates, respectively. There are additional macros for precipitation figures as in this case 24-hour amount is evaluated instead of precipitation between 2 time steps (*insertprecpics*).
  4. Choose a case study and a meteorological variable you intend to investigate, for instance the effect of the different resolutions on temperature at 850 hPa in Desmond case initialized at 00 UTC on 3 December 2015. Select the corresponding macro which is aa_insertpicsOIFS_resolutions and click "Edit". The macro source code can be seen in the opening window:
  5. This macro creates a table with figures for a given meteorological variable in every 3 hours between 00 UTC 5 December and 00 UTC 6 December from 3 OpenIFS runs carried out on T255L91, T637L137 and T1279L137 resolutions and also from the ERA-Interim and ERA5 re-analysis data (see Figure 2).
  6. To make the catalogue, you will need the figures for the temperature at 850 hPa from the gryg, gs22 and gs23 experiments. Let us suppose that your figures are located here: ${LOCAL_FIGURE_PATH}/t_850_${expID}_20151203+${step}, where LOCAL_FIGURE_PATH is the folder of the figures (with full path), expID is the 4-digit experiment ID and step is the forecast lead time going here from 48 to 72 hours. There are default settings in the macro code (see the highlighted line in the window above), which you have to adjust to your settings regarding the path of the figures (LOCAL_FIGURE_PATH), the name of the meteorological variable (t_850), the experiment IDs (gryg, gs22, gs23), the starting date (20151203) and the steps in the figure filename.
  7. All the necessary changes can be made via automatic replacement in a few steps. Press CTRL+H and give the string to be replaced (e.g., gust_0) and the replacement string (t_850). After all the changes are done, the macro is ready to run with the green triangle: .
  8. The macro produces an automatic caption above the table with the default settings. You can change or remove this title manually (or if you are professional in writing Word macros, you can edit the corresponding code directly in the  macro).
  9. After all steps and adjustments, you can save the document as a .docx (.doc) file.
  10. The same procedure can be repeated for further variables, starting dates and case studies.

The instructions above are valid in MS Office 2013. The steps can be slightly different in other MS Office versions.


Figure 2: Illustration of the catalogue constructed from the output figures using Word macros. Here: 3-hourly 10-meter wind gust (m/s) from ERA-Interim and ERA5 re-analyses and from T255L91, T639L137, T1279L137 OpenIFS forecasts initialized from ERA-Interim on 4 December 2015.

The HTML templates are prepared separately for the two case studies. They are zipped and available in the ECMWF download server.

  1. Assuming that all the output pictures the user created for storm Xaver are placed in the same directory, the .tar.gz file has to be downloaded and uncompressed also here:

    % INPUTDIR=http://download.ecmwf.int/test-data/openifs/reference_casestudies/
    % wget -c ${INPUTDIR}figs/Xaver/png-ps/Xaver_OutputBrowsing.tar.gz   # to download the templates
    % tar -xzvf Xaver_OutputBrowsing.tar.gz                              # to unpack the archive file
  2. The templates can be activated with opening any of the .html files (e.g., resolution_ERAI.html) in a web browser (Firefox or else) and further instructions can be read there (see Figure 3 as an example).

  3. To retrieve the HTML templates for storm Desmond:

    % INPUTDIR=http://download.ecmwf.int/test-data/openifs/reference_casestudies/
    % wget -c ${INPUTDIR}figs/Desmond/png-ps/Desmond_OutputBrowsing.tar.gz   # to download the templates
    % tar -xzvf Desmond_OutputBrowsing.tar.gz                                # to unpack the archive file
  4. To activate the templates for storm Desmond, repeat step 2.


 

Figure 3: Illustration of the catalogue constructed from the output figures using HTML templates. Here: loading the resolution_ERAI.html comparing the impact of the T255L91, T639L137, T1279L137 resolutions on the OpenIFS forecasts for storm Xaver.


Back to top