AXF (historical) format

AXF format was established by BODC as an exchange and archive format. It has since been superseded but is described here for completeness. If you still have data in AXF format and require assistance please contact the BODC Enquiries Officer.

The format is based on a set of simple, generalised building blocks that may be assembled in many different ways. This can be confusing and lead to many different ways of encoding similar or even identical data. Therefore, this document also defines a subset of AXF (the BODC series subset) that was designed for instrumentally measured wave data, but is applicable to a wide range of oceanographic measurements. AXF users are advised to adopt this wherever possible.

This document assumes you are familiar with programming terms.

Format specification

AXF is a comma-separated, self-descriptive, easily adaptable format. Each line of the file starts with a field defining the record type. Integer, real and character data can be accommodated. This enables the writing of simple one-off Fortran programs as well as allowing simple procedures for spreadsheet and database input. Please see the following for further information

  1. Record definitions
  2. Parameter types
  3. Units
  4. Absent and default values
  5. Maintaining easy Fortran legibility
  6. Buffer size
  7. Record ordering
  8. Nomenclature
  9. Multiplicity
  10. BODC series subset
  11. Flagging
  12. Example 1
  13. Example 2

1. Record definitions

Each line can contain no more than one record and no record can span more than one line. Blank lines are permitted. Comments are introduced through a double slash. Blank-commented lines (i.e. lines with no formal data content) are not allowed unless they begin with a double comma (this facilitates the construction of Fortran programs).

Each record begins with a record type identifier. Record types 0-9 that are not defined below are reserved. User-defined record types are in the range 10-99.

0,0,'AXF','0.0'                       //Format & Version
0,1,'yyyymmdd','hh24miss'  //Date/time of creation
0,2,maxreclength                //Maximum length of line in bytes - defines buffer size
0,3,datacyclecount              //No. of 'cycles'
0,4,'file_identifier'               //Internal reference for file. No embedded blanks
0,5,'text'                             //Records 0,6-9 are reserved

1,udrr,param,type,absent data value,defaultvalue   // udrr =User Defined Record Reference
2,udrr,lower,upper                                                    // Defines multiplicity (see below)
,,                                                                                // If lower omitted is assumed 0,
,,                                                                                // if upper omitted it is unlimited

Example 1 (a timeseries originating from a thermistor chain) and Example 2 (a BODC subset series to store Wave Spectra) are provided below.

2. Parameter types

In the above param (parameter name) type, file_identifier are type character; other identifiers are integer.

Type takes the form 'D' (double-precision float), 'F' (single-precision float), ''I' (integer), 'A' (alphanumeric - arbitrary width) or 'Anum' (alphanumeric with specified maximum width) where num defines the maximum field width.

Floating point numbers can be expressed in scientific notation where appropriate (E.g. 0.1234, -12.45e-12 are legitimate). For compatibility with a wide range of Fortran implementations, including Fortran 90, embedded blanks and the omission of the 'e' or 'E' (123e-4 is sometimes rendered as 123-4) should be avoided.

Alphanumerics appear in single quotes. Embedded single quotes are doubled.

3. Units

Units are not explicitly defined in the parameter description. They may be included in supplementary text, through comments or implicitly defined through parameter codes for which units have been specified.

4. Absent and default values

The absent data value may be the same as the default value. The absent data value is the value assumed by the parameter to signify that no data are available.

The default value is assumed when a field is null, that is a field bounded either by the start of the record and a comma, or by two commas, and which consists solely of zero or more blanks. Default values are handy for dealing with sparse or repetitious data.

In the absence of definition of the absent data value alphanumerics assume the value blank, and numerics the value -1. If the default value is undefined it is set equal to the absent data value.

5. Maintaining easy Fortran legibility

As noted above a null field is defined as white space (0 or more blanks) between the beginning of the record and a comma, or white space between two commas. It is not defined to be white space between a comma and the end of a record. This is because in Fortran 77, although a READ will begin at the start of a record, record boundaries are subsequently ignored in this form of input. To ascertain whether a field is null or not Fortran will pull in the next record if confronted with white space and read to the next comma. Thus one has to terminate each line ending in a null field with an additional comma.

6. Buffer size

The default buffer size is 80. Other type 0 records can be omitted with the exception of 0,0. Including cycle count facilitates programming and provides a check on file truncation or extension.

7. Record ordering

Most of the following rules are intended to simplify programming. They are in fact consistent with the natural order derived from sorting on the first two fields of each record within the header section of the file. Ordering within user-defined records within the body of the file is a matter for subset specification.

Record 0,0 should appear first in the file. Record types 0-9 should precede user-defined records. The buffer length specification should precede the point where the buffer length is required. The order of prescription identifies the order of the fields in a user-defined record. However all fields belonging to a given record must be specified contiguously in the file. Type 2 records must come after the corresponding type 1 definition records.

8. Nomenclature

A repeating group is a set of several readings of a parameter set registered for a given cycle of measurement. E.g. the parameter set would consist of (just) temperature for thermistor chains, parameters which are dependent on frequency (e.g. peak direction) for spectral wave data, and current velocity for an Ocean Surface Current Radar. The respective ancillary information would be heights above sea floor or depths below sea surface, the frequency set and cell positions.

9. Multiplicity

Type 1 records define parameter sets. Names within the parameter set are not required to be unique. Each user-defined record contains one or more cycles where a cycle is defined to be a set of values associated with the parameter set. The number of cycles in a particular record type may well vary throughout the file.

Type 2 records define what is termed multiplicity. Where a lower limit on multiplicity has been specified that number of cycles must be present in the file before switching to an alternative record type (parameter set) or encountering the end of the file. If the multiplicity is fixed (N=lower=upper) the number of cycles in the file for the associated parameter set must be a multiple of N. If a type 2 record is omitted the multiplicity is 1.

10. BODC series subset

Record 11 defines the ancillary parameter set. Record 21 holds the non-repeating elements of the cycle. Record 31 holds the repeating group. Data types with more than one repeating group are specifically excluded. If there is no repeating group only type 21 records will be present in the body of the data. Record 11 occurs once and precedes the cycle data. Record 21 precedes 31 in each cycle.

In records 21 and 31 parameters, with the exception of day number, are flagged. This means that there are one-byte alphanumeric channels named 'Flag' which succeed each parameter in the parameter-set definition. See Flagging below.

Parameters are specified using codes from the BODC Parameter Dictionary, which implicitly defines the units in which the data are stored.

11. Flagging

The flag channel is used to qualify the data. BODC uses 'N' to signify a null value and blank to signify a good one. Other flag values will be defined in the data documentation.

12. Example 1

An example of a timeseries originating from a thermistor chain. Conforms to BODC's series subset.

0,3,814 //Number of cycles is 814
0,4,'THCHA4 '
0,5,' The thermistor chain was deployed from RV Boethius'

1,11,'ADEP','F',,, //Depth of thermistors
2,11,15,15 //Number of thermistors

1,21,AADY,'I',-1,, //Day number of cycle (since 1760.1.1)
1,21,'AASC','I',-1,, //Time in seconds of day of
1,21,'Flag','A1',,, // cycle
1,31,'TEMP','F',-9,, //Temperature. Absent value
1,31,'Flag','A1',,, //Temperature flag
2,31,15,15 //There must be 15 readings per cycle

11,15,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45 //Depth set

21,,87654,36000 //This cycle is logged at 10am, 28/12/1999
31,4, 3.4,,4.5,,4.5,,4.5,,
31,4,4.5,,5.6,'M',4.5,,4.6,, //Note flag. The ',,' signify blank flags
21,,87654,36060 //Next cycle
31,10,3.4,,4.5,,4.5,,4.6,,4.5,,5.6,'M',4.5,,4.6,,4.7,,4.8,, //Unlikely to mix the form of the output
,, //in this way in practice
31,5,5.1,,5.1,,4.6,,7.7,'M',,'N', //Absent data value at end (Fill=Absent)

13. Example 2

We use the BODC series subset to store Wave Spectra. The frequencies are stored in records with type 11 and the power values (and spread, peak direction, etc. for 2-D spectra) are accommodated in records of type 31.

0,1,'19960710','162147' // Date/time file produced
0,2,80 // Buffer size
0,3,362 // Number of cycles
0,4,'PR9410.N1' // Internal file name
1,21,'Flag','A1',,' '
1,21,'Flag','A1',,' '
1,21,'Flag','A1',,' '
1,21,'Flag','A1',,' '
1,21,'Flag','A1',,' '
31,5 .............................

Related BODC pages

BODC request (ASCII) format     BODC parameter codes
QXF (a netCDF) format