The Library of AMIP Data Transmission Standards 
General Description and Guidelines for AMIP Users

http://www-pcmdi.llnl.gov/software/lats
 lats@pcmdi.llnl.gov


Contents


Overview

LATS is a library of software routines to output gridded data developed by PCMDI in support of AMIP II and other intercomparison projects. The primary function of LATS is to establish and implement a convention/standard for gridded data and thus facilitate data handling and exchange. The LATS Application Programmer Interface (API) is designed to be simple to understand and use. FORTRAN and C APIs are provided.

LATS applications output data in either the WMO "GRIdded Binary" (GRIB) format or in the NetCDF format under the COARDS convention. LATS-generated data written according to the GRIB or COARDS conventions is readily accessible by CDAT, GrADS or EzGET.  A variety of other software packages recognize the NetCDF COARDS convention.

However, rather rigid constraints are placed on the structure (e.g., dimension ordering) of data written and thus in its current form LATS is not be considered a general purpose gridded data output system. These constraints are a consequence of the following design criteria:


Basic Features of LATS

Restrictions:

Usage

The LATS API consists of eleven functions. Detailed information on each of these functions is contained in the man page. An outline of a LATS program, including reference to several LATS functions, is given below:
1. Specify an external parameter table file, with lats_parmtab.
2. Define all grid(s), with lats_grid.
3. Define all vertical dimensions (e.g., pressure level) with lats_vert_dim. If a default surface dimension is defined for a variable, it does not have to be redefined with lats_vert_dim. Grids and vertical dimensions may be shared across variables and files. NOTE: At present, only one grid may be defined per GrADS/GRIB file.
4. Create a LATS file, with lats_create.
4a. Optionally set the basetime, with lats_basetime
5. For each variable to be written to the file: Declare the variable with lats_var. (Note: this is required even if the variable has been declared for a different file)
If there is a missing data flag, define it with lats_miss_float or lats_miss_int.
6. For each time-point, in increasing time order: For each horizontal level of each variable: Write the data for this level, time-point, with lats_write.
7. Close the file, with lats_close.
It is possible to write structures other than fully 2-D horizontal longitude-latitude grids. For example, to write zonal mean vs. height cross sections, the grid must be defined as containing a single longtitude (a dummy value) in lats_grid. One latitude grid (a 1-D array) at each level would be written with lats_write.

The LATS distribution comes with a sample FORTRAN code and detailed instructions on creating LATS applications. This program is used to verify that LATS is working properly on your system. Furthermore, the distribution is self contained, i.e., all materials needed for creating LATS applications are included, ranging from the libraries and utilities to documentation on setup and application building. Consult the LATS man pages for a detailed description of the LATS programming interface.


Guidelines for AMIP II Users

Although LATS was geared for AMIP II data, there are additional guidelines that need to be followed by AMIP II participants. These additional constraints will ensure even greater data processing efficiency and more rapid data distribution.

LATS Format and Convention Options: Pros and Cons

The two format options in LATS, netCDF and GRIB, have distinctly different advantages. AMIP II users are free to choose the LATS format which is most appropriate for their needs but are required to use either the LATS_COARDS or LATS_GRADS_GRIB conventions listed below. The LATS Convention defines how the data and the metadata (data on the data) are structured as well as the actual file format. It is the standards on metadata and structure that makes LATS data accessible to a data intreface. Some factors to consider when choosing LATS format/convention options are summarized below. Note that the data format is implied by the convention.

Convention options:

LATS_PCMDI (netCDF): Permits the use of calendars other than the standard Gregorian calendar. Other than the calendar options, this option is at present consistent with the COARDS conventions. Future releases may provide other extensions beyond the COARDS convention. Files created with this convention may be used with all netCDF utilities, except those that require the COARDS convention (e.g., GrADS). As this is an evolving convention, its use in AMIP II is not supported.

LATS_COARDS (netCDF): Compliant with the COARDS metadata standard . If this convention is chosen, the calendar must be specified to be Gregorian (LATS_STANDARD calendar). Internally, monthly data are represented in units of "days since (basetime)". Climatology data are assumed if year = 2. Fixed fields (e.g., topography) is assigned the year 1.

LATS_GRADS_GRIB: WMO GRIB format (GRIB), plus a GrADS control file and a GRIB map file. Variables must be defined on the same horizontal grid. Supports, all calendar options except Julian and 360-day years.

LATS_GRIB_ONLY: WMO GRIB only. The delta (see LATS man page) may be zero. This convention is the most general, but may not be readily interfaced to VCS and GrADS. Appropriate for straight data transmission with no need for direct data interface.

Data format pros and cons:

netCDF - advantages: There is a wide range of tools available for netCDF data, and it is used extensively in the atmospheric science research community, particularly among universities. The netCDF data model is general and flexible. All quality controlled AMIP data released to diagnostic subprojects will be in netCDF.

netCDF - disadvantages: Requires installation and use of the netCDF libraries. For some platforms, netCDF version 2.4 or greater must be used for performance reasons. At present, LATS does not support the COARDS data compression (offset plus scaling to 16-bit integers) option, but will do so in a future release. Data writing and reading can be much slower than GRIB, particularly for large grids (e.g., 360x180 points).

GRIB - advantages: GRIB is a WMO standard and is widely used at most numerical weather prediction centers (e.g, ECMWF and NCEP). GRIB features flexible compression options on a variable-by-variable basis and the binary format is generally simple. For AMIP II high frequency (6-h) data, GRIB files will be on average 2.5 times smaller than netCDF format, i.e., a space savings of ~60%.

GRIB - disadvantages: GRIB is primarily a physical format with metadata defined for each 2-D grid (i.e., a "GRIB message") only. Thus, GRIB data cannot be organized internally as higher dimensional data sets. The higher dimensional structure achieved in the LATS_GRADS_GRIB convention is though a mapping function not part of the format. For example, all variables in a file must share the same vertical dimension, and multilevel variables must share the same vertical dimension.  Beyond the GrADS interface, there are no standard programming interfaces and a variety of GRIB 'flavors' (LATS uses WMO GRIB Edition 1 and the NCEP tradition) have evolved complicating interface building.


Design Constraints and Resulting Limitations

The LATS software library was designed under two overarching constraints -- simplicity and two-format output. Supporting output of both netCDF and GRIB, from the same interface, required rectification to a common denominator. netCDF is a self describing, data-set orientated (e.g., 4-D variables) format whereas GRIB is only designed to output 2-D lon/lat grids. The GrADS interface allows GRIB data to be treated as if it where a data-set in the netCDF sense (i.e, the netCDF 4-D "data model"). Thus, to support the GrADS interface to GRIB and for consistency with netCDF, LATS requires all variables to be declared (including all their dimensions and attributes), before any numerical data are written. While netCDF does in fact allow an application to define and write in any order, additional functions would have to be added to the LATS API making the system more complex. Further, a relaxation of the define once, then write constraint would allow for a greater range of data structures (e.g, a set of time-series) and thus greater complexity in the processing at PCMDI. However, we expect to ease the define once, write many restriction in future versions.

Although four conventions may seem complex, it is symptomatic of the wide variation in existing data sets as conventions are often specific to an individual. The purpose of a convention is to improve the efficiency of a group and the lack of conventions for AMIP I was very costly to PCMDI as we had to bring the disparate data sets (all 30 model data sets were different) to some common standard. Relative to AMIP I, four conventions will greatly improve the efficiency of PCMDI and our ability to support analysis of the AMIP II results.

While the valid year of a climatology field may have no mean, it is generally required by data interfaces. LATS internally sets a time convention for climatology and fixed fields. Again, there are no obvious standards for describing the valid time of climatology or fields such topography. Thus, we have arbitrarily set the valid year of a data written under the climatology calendars to the year 2 AD and fixed fields to 1 AD.

CDAT, EZGET (a Fortran interface) and GrADS can read both GRADS_GRIB and netCDF (COARDS) LATS-generated data. FERRET, and many other applications  can be used to access the  netCDF (COARDS) LATS-generated data.  EZGET users creating applications that link to both EZGET and LATS may experience problems because of compiler-dependent resolution of externals (functions). The issue is compatibiliity between cdunif and lats routines which is now being corrected at PCMDI.


Planned enhancements

In addition to formatting data, LATS provides some basic data quality control facilities (not included in the table of the current release). Note also that the current release of LATS requires the netCDF library, even for those users who only intend to use the LATS_GRADS_GRIB convention. The current version is expected to be sufficient for use throughout AMIP II. Future software modifications/enhancements will be fully backwards compatible with the current version.  The current list of planned enhancements is:

Obtaining LATS

The LATS distribution consists of the libraries (LATS and netCDF), include files, documentation, sample code, and utilities for reading LATS generated files. The distribution is simply a compressed tar file and everything needed is contained inside.

The LATS (latest version) source code for is available, and  has been built on the following platforms:
 
Distribution
Name 
Machine 
uname -a 
Latest version available 
source code
-
-
LATS 1.5
aix 
IBM RS4000 
AIX 2 3 000039577000 
LATS 1.0
alpha 
DEC Alpha 
OSF1 V3.2 41.64 alpha 
LATS 1.5
c90 
CRAY C90 
sn4005 8.0.4 u31.20 CRAY C90 
LATS 1.3 
hpux 
HP 
HP-UX A.09.01 A 9000/755 
LATS 1.3 
irix4 
SGI 
IRIX 4.0.5 06151813 IP12 
LATS 1.0 
irix5 
SGI 
IRIX 5.3 11091812 IP22 mips 
LATS 1.3 
irix6 
SGI 
IRIX 6.2 
 LATS 1.5 
j90 
CRAY J90 
sn9550 9.0.2.2 car.6 CRAY J90 
LATS 1.5
linux 
x86 PC 
Linux 2.0.21 #5 
LATS 1.0
sol2 
SUN 
SunOS 5.5.1 Generic_103640-03 sun4d 
LATS 1.5
sunos4 
SUN 
SunOS 4.1.3 1 sun4m 
LATS 1.5

If your system does not exactly match, try a version which is close. The libraries will generally work within operating system major versions (e.g., 2 in version 2.5.1 of Solaris (now called 5.5.1) or with an OS at a higher version (e.g., V3.0 LATS will often work in OS V4.0). LATS built on system with a higher version than that of the target system may work, so try the library for your platform.

If you are unable to find a compatible version, then please contact lats support (lats@pcmdi.llnl.gov).
 

Click here to obtain LATS through the web
Please see the README file in the LATS root directory for instructions on setting up the distribution and where to go after that.


Web resources

The following table gives a summary of web resources for LATS and related software.
 
Resource 
URL 
PCMDI 
http://www-pcmdi.llnl.gov
LATS 
http://www-pcmdi.llnl.gov/software/lats/
GrADS 
http://grads.iges.org/grads/
CDAT 
http://www-pcmdi.llnl.gov/software/
netCDF 
http://www.unidata.ucar.edu/packages/netcdf
GRIB 
ftp://ncardata.ucar.edu/docs/grib/guide.txt
COARDS 
http://ferret.wrc.noaa.gov/noaa_coop/coop_cdf_profile.html
wgrib 
http://www.cpc.ncep.noaa.gov/products/wesley/wgrib.html


Return to PCMDI Software home page

Last update July 15, 1998. For further information, contact the AMIP Project Office (amip@pcmdi.llnl.gov) or lats@pcmdi.llnl.gov.

LLNL Disclaimers

UCRL-MI-125598