You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

Gridded data in NetCDF format

Gridded, structured data can be read from NetCDF files that follow the Climate and Forecast (CF) Metadata Conventions. Define a dataset consisting of CF-compliant NetCDF files by selecting "File→New Dataset" in the Met.3D main window, or alternatively, by adding the following entry to your user-defined pipeline.cfg file (cf. https://gitlab.com/wxmetvis/met.3d/-/blob/master/config/default_pipeline.cfg.template):

1\name=YOUR DATASET NAME
1\path=/your/path/data/netcdf
1\fileFilter=*ecmwf_ensemble_forecast*EUR_LL10*.nc
1\schedulerID=MultiThread
1\memoryManagerID=NWP
1\fileFormat=CF_NETCDF
1\enableRegridding=true

All files in the specified path that match the given file filter will be used for the dataset. See the file default_pipeline.cfg.template (https://gitlab.com/wxmetvis/met.3d/-/blob/master/config/default_pipeline.cfg.template) for further comments on the meaning of the individual keywords.

Forecast variables, time steps and ensemble members can be arbitrarily distributed over the files that match the file filter. You can store all ensemble members in one file but have different files for each time step, or vice versa. Or everything can be stored in a single file.

The following example contains a NetCDF header of a file containing an ensemble forecast on pressure levels:

netcdf somegriddeddata.pl {
dimensions:
    lon = 101 ;
    lat = 41 ;
    isobaric = 12 ;
    time = 1 ;
    ens0 = 51 ;
variables:
    float lat(lat) ;
            lat:units = "degrees_north" ;
    float lon(lon) ;
            lon:units = "degrees_east" ;
    float isobaric(isobaric) ;
            isobaric:units = "hPa" ;
            isobaric:long_name = "Isobaric surface" ;
            isobaric:positive = "down" ;
    int time(time) ;
            time:units = "Hour since 2012-10-15T00:00:00.000Z" ;
            time:standard_name = "time" ;
    int ens0(ens0) ;
            ens0:standard_name = "ensemble_member_id" ;

    float Geopotential_isobaric(time, ens0, isobaric, lat, lon) ;
            Geopotential_isobaric:long_name = "Geopotential @ Isobaric surface" ;
            Geopotential_isobaric:units = "m2.s-2" ;
    float Temperature_isobaric(time, ens0, isobaric, lat, lon) ;
            Temperature_isobaric:long_name = "Temperature @ Isobaric surface" ;
            Temperature_isobaric:units = "K" ;

    ...
}

The time encoded in the units attribute of the time dimension is used as the forecast base/initialisation time.

The ensemble dimension is currently not specified in the CF conventions. Met.3D simply searches for a variable with a standard_name attribute set to ensemble_member_id. For now, the _CoordinateAxisType used by the netcdf-java library (_CoordinateAxisType = "Ensemble") is also acceptable. (See the Met.3D source code method NcCFVar::getEnsembleVar() in nccfvar.cpp).

The following example contains a NetCDF header of a file containing an ensemble forecast on hybrid sigma-pressure levels; the required keyword of the vertical variable are different; cf. Appendix D of the CF-conventions.

netcdf somegriddeddata.ml {
dimensions:
    lon = 101 ;
    lat = 41 ;
    hybrid = 62 ;
    time = 1 ;
    ens0 = 51 ;
variables:
    float lat(lat) ;
            lat:units = "degrees_north" ;
    float lon(lon) ;
            lon:units = "degrees_east" ;
    float hybrid(hybrid) ;
            hybrid:units = "sigma" ;
            hybrid:long_name = "Hybrid level" ;
            hybrid:positive = "down" ;
            hybrid:standard_name = "atmosphere_hybrid_sigma_pressure_coordinate" ;
            hybrid:formula = "p(time,level,lat,lon) = ap(level) + b(level)*ps(time,lat,lon)" ;
            hybrid:formula_terms = "ap: hyam b: hybm ps: Surface_pressure_surface" ;
    int time(time) ;
            time:units = "Hour since 2012-10-15T12:00:00.000Z" ;
            time:standard_name = "time" ;
    int ens0(ens0) ;
            ens0:_CoordinateAxisType = "Ensemble" ;

    double hyam(hybrid) ;
            hyam:long_name = "hybrid A coefficient at layer midpoints" ;
            hyam:units = "Pa" ;
    double hybm(hybrid) ;
            hybm:long_name = "hybrid B coefficient at layer midpoints" ;
            hybm:units = "1" ;

    float Temperature_hybrid(time, ens0, hybrid, lat, lon) ;
            Temperature_hybrid:long_name = "Temperature @ Hybrid level" ;
            Temperature_hybrid:units = "K" ;
    float Specific_humidity_hybrid(time, ens0, hybrid, lat, lon) ;
            Specific_humidity_hybrid:long_name = "Specific humidity @ Hybrid level" ;
            Specific_humidity_hybrid:units = "kg/kg" ;

    ...
}

Gridded data in GRIB format

Met.3D provides support for GRIB files written by ECMWF’s ecCodes library (as output, e.g. by the ECMWF MARS archive or written by Metview).

In your pipeline.cfg file, simply change the fileFormat entry to ECMWF_GRIB:

1\name=YOUR DATASET NAME
1\path=/your/path/data/grib
1\fileFilter=*ecmwf_ensemble_forecast*EUR_LL10*.grb
1\schedulerID=MultiThread
1\memoryManagerID=NWP
1\fileFormat=ECMWF_GRIB
1\enableRegridding=true
  • GRIB messages may be arbitrarily distributed over different files that match the specified fileFilter.
  • Support is currently only provided for a horizontally regular longitude/latitude grid (GRIB gridType = regular_ll) and either pressure (GRIB typeOfLevel = isobaricInhPa) or hybrid sigma-pressure levels (GRIB typeOfLevel = hybrid) in the vertical.
  • Hybrid sigma-pressure model levels additionally require the surface pressure field (GRIB shortName = sp) or its logarithm (GRIB shortName = lnsp) to be present in the dataset.
  • Analysis (GRIB dataType = an), forecast (GRIB dataType = fc) and perturbed/control (i.e., ensemble forecast; GRIB dataType = pf/cf) messages are interpreted.
  • For 3D fields, a consistent consecutive list of vertical levels must be present for all time steps and ensemble members of a dataset. Levels need not be complete (i.e., there can be missing levels at the top or bottom) but the same levels need to be provided for all data fields in a dataset.
  • For a given dataset, all GRIB messages must have the same horizontal extent.

Grib Index Files

Unlike NetCDF files, GRIB files do not contain global headers that summarize the information contained in the file. Hence, to know which data is stored in a file the entire file needs to be read. This, of course, is inefficient when the file is accessed multiple times from different Met.3D sessions. Met.3D hence creates index files that store such a "global header" when first accessing GRIB files. You will find these files along with the GRIB files in the directory in which the GRIB files are stored. Note that your user ID hence requires write access to the directory in which the GRIB files are stored. If you don't have write access, we recommend placing symlinks to the files in a directory to which you have access and in which the index files can be stored.


  • No labels