From test to production archiving in 3 steps

The archiving of UERRA data in MARS should be done by each provider on his own with full support of ECMWF's team.

The ECMW's account is needed to be able to archive data in MARS and access the database online or via web-api interface.

Data checking

As for any good data archive it is crucial to have working data quality checking in place. Every data provider should double check that their parameters are fully compliant with required and agreed definitions linked in the main parameter page. A special attention before any archiving activities must be paid for example to correct units, fluxes sign conventions etc as specified in the GRIB2 encoding page. The additional checking tools provided by ECMWF and described below cannot discover all types of possible fundamental errors from principle (like incorrect units or reverse sign of fluxes where values range is both positive and negative).

Here are three steps to follow to archive data in MARS:

    The MARSSCRATCH is temporary development version of MARS database. Anybody can use it for the first preliminary tests but the data can disappear at any time even it is not happening most of the time.
    Example of COSMO sample data stored in MARSSCRATCH:
  2. MARS (expver=test)
    Before the full production archiving (step 3) a few days of full UERRA data from given model are required to be archived in MARS with expver=test. It must be thoroughly checked that all fields were archived as expected (no missing or additional ones; no missing or additional steps, levels etc.). The data archived as expver=test might be overwritten during this phase.
  3. MARS (expver=prod)
    Once all providers' processing and archiving scripts are verified as fully working during step 2, the production archiving can start. The production data in MARS might not be overwritten in the future as it is user data who can download them in any time so the step 2 has crucial importance. It is also very difficult to delete any unwanted data from production MARS e.g. archived by mistake so it should be avoided by all means. Only one user ID per provider is expected to have granted permissions for archiving in MARS to avoid any kind of possible double archiving in the same time etc.

How to archive effectively

It is important to archive UERRA data effectively following MARS design specific for this type of dataset. The possible suboptimal archiving (e.g. one parameter by one in each archiving request instead of archiving them all together) would cause various MARS performance issues which could be avoided.

Using archiving scripts which will be provided (see below) each provider will archive always all data from one day at once for given origin, stream and levtype (i.e. all parameters, times, steps and levels together). If any MARS performance issue occurs during test and production archiving with that approach it might be needed to change it.

As a consequence of MARS design for UERRA datasets up to one full month model data could be theoretically archived at once (again for given origin, stream and levtype as usually).


Following tools will be available for providers to allow smooth data processing and archiving in MARS:

Conversion script from GRIB1 to UERRA compliant GRIB2

For models which produce the input data for MARS still in GRIB1 the conversion scripts to the required GRIB2 format will be provided. They are based on GRIB-API grib_filter tool which requires the GRIB-API version fully supporting all UERRA parameters.

Examples of grib_filter rules for GRIB1 HARMONIE parameters:

Archiving request

An example how to archive full data sample produced by given model will be provided to each partner. Basically only the date should change in the script otherwise the content of archive is expected not to be changing for the whole archiving period (i.e. homogeneous data without gaps or any other variation is expected).

Example of MARS archiving request for full surface, soil and model level data from HARMONIE deterministic reanalysis (origin=eswi, stream=oper, type=an):

MARS archiving request
# $date must be parsed with appropriate date before running MARS request below




Checking tools

There are 2 types of checking tools which must be run before and after archiving to try to minimize possible errors in the archive

  1. UERRA-GRIB2 checking tool (tigge_check)
    This tool should be run on all input files already in GRIB2 UERRA compliant format before archiving them. It checks all encoding details so that only fully compliant UERRA files following exactly required definitions would pass. It can check also allowed value ranges for each parameter if used with the option -v.

    The tigge_check can check only the encoded  GRIB2 keys to have them compliant with expected UERRA definitions specified generally for all UERRA datasets and each particular parameter. Some types of possible fundamental errors cannot be nevertheless revealed by the the tool from principle (e.g. incorrect units which are never encoded in GRIB2 files or a possibly wrong (reverse) sign of fluxes where values range is both positive and negative.

    The data min/max value checking provided by tigge_check (-v) must be considered only as a helping option to have some chance to reveal sometimes real data issues. In some cases e.g. for radiation fluxes the allowed limits must be very flexible as for example direct solar radiation in 1-hourly outputs changes from 0 to 1+e9 depending on  forecast step.

    The tuning of the allowed limits for numerous parameters from different models on varying domains as in UERRA case is tricky and it is an ongoing process. On top of it there are sometimes clearly wrong values coming from some models during specific weather situations (e.g. grid point storms with wind speed exceeding 900 m/s). After an agreement with data provider the tool can allow such unrealistic values for given model as "normal". It should be understood that such data will have user impact and might be still considered as poor output data quality checking.

  2. MARS archive content checking script
    This kind of script is required to be run after each archiving to check that only expected fields were archived successfully (always the same parameters without any change). The checking script below is based on MARS list functionality.

    Example of MARS list request checking the content of MARS for COSMO data from 1993-12-31.

    MARS checking scripts
          class      = ur,
          stream     = oper,
          type       = all,
          date       = 19931231,
          time       = all,
          levtype    = all,
          origin     = eswi,
          expver     = test,
          hide       = file/length/offset/id/missing/cost/branch/date/hdate/month/year,
          target     = tree.out,
          database   = marsscratch,
          output     = tree
          class      = ur,
          hide       = file/length/offset/id/missing/cost/branch/param/levtype/levelist/expver/type/class/stream/origin/date/time/step/number/hdate/month/year,
          target     = cost.out,
          output     = table

    The tree.out content should be the same for all archived dates what can be easily checked e.g. with unix diff tool against the reference MARS list output created from the very 1st properly archived day for given model.

    tree.out content
    cost.out content
    Grand Total:
    Entries       : 13,852
    Total         : 8,931,971,037 (8.31855 Gbytes)
    > archived=$(cat cost.out| grep ^Entries|sed s/,//g| sed 's/.*: //')
    > echo $archived
    > 13852

    The number of fields archived must be always the same. That number can be easily parsed from the above output for example using unix grep:

    Number of fields archived
    > archived=$(cat cost.out| grep ^Entries|sed s/,//g| sed 's/.*: //')
    > echo $archived
    > 13852