Skip Navigation Links weather.gov 
NOAA logo - Click to go to the NOAA homepage National Weather Service   NWS logo - Click to go to the NWS homepage
National Centers for Environmental Prediction
Navigation Bar Left Cap
Navigation Bar End Cap
 

NCEP Home > NCO Home > Systems Integration Branch > Decoders > Decoder Interface Format

The NCEP Decoder Interface Format

The interface format was developed to provide a simple, generic transition state between the point when data for a particular report is initially decoded (i.e. parsed) from its WMO bulletin representation and the point when it is re-encoded into the final format required by the local end-user application. As such, the interface format represents the decoded data in a pure form, logically disconnected from any particular or proprietary storage scheme, and it allows for easy manipulation by the end-user in order to fulfill his or her own unique data-format requirements. Practically speaking, it allows the same decoder/parsing software to be run by a variety of organizations, since each needs only to supply their own software for converting the interface format into their own ultimate format of choice.

The interface format is implemented within each decoder as two distinct sets of FORTRAN arrays, one for REAL data and one for CHARACTER data. Each set consists of an array of mnemonics (descriptive names), an array of values which correspond to these mnemonics, and a collection of pointers which link these two arrays. To illustrate this, consider the following simple example of REAL interface format data from within the aircraft decoder:

        PARAMETER       ( NRIMN = 23 )
C*                                      Number of real interface
C*                                      mnemonics
C*
        CHARACTER       rimnem ( NRIMN )*8
	DATA	( rimnem ( i ), i = 1, NRIMN )
     +  /   'SLAT'  , 'SLON'  , 'DRCT'  , 'SKNT'  , 'TMPC'  , 'DWPC'  ,
     +      'RELH'  , 'SSTC'  , 'PMSL'  , 'FLVL'  , 'PSAL'  , 'POAF'  ,
     +      'ACNS'  , 'TADR'  , 'PCAT'  , 'MDEVG' , 'DAYW'  , 'VSBY'  ,
     +	    'YEAR'  , 'MNTH'  , 'DAYS'  , 'HOUR'  , 'MINU'  /
C*                                      Real interface mnemonics
C*
        REAL            rivals ( NRIMN )
        COMMON  / RINTFV /      rivals
C*                                      Real interface values
C*
        COMMON  / RINTFP /
     +     irslat  , irslon  , irdrct  , irsknt  , irtmpc  , irdwpc  ,
     +     irrelh  , irsstc  , irpmsl  , irflvl  , irpsal  , irpoaf  ,
     +     iracns  , irtadr  , irpcat  , irmdvg  , irdayw  , irvsby  ,
     +	   iryear  , irmnth  , irdays  , irhour  , irminu  /
C*                                      Pointers to relative locations of
C*                                      real interface mnemonics within
C*                                      rimnem ( ).
  
As noted in the above comments, the REAL interface mnemonics are defined within the array rimnem, and the corresponding values are stored within the array rivals. During startup, the decoder will set the pointers within COMMON / RINTFP / and then use these pointers to store the value corresponding to each mnemonic into its appropriate relative position within the values array. These pointers and the values they point to are all stored within COMMON, so they are accessible to any subroutine within the decoder, including any supplied by the end-user for re-encoding into the desired final format. In fact, data stored in FORTRAN COMMON can also be made accessible to a user-supplied C function, so it is not even a requirement that the end-user write his or her re-encoding logic in FORTRAN in order to be able to access the interface arrays! Examples on re-encoding in C are given within the implementation instructions for the software; thus, within this document, the logic examples will all be shown in FORTRAN only since the concept of accessing the interface arrays is irrespective of the particular programming language used.

As an example from within the aircraft decoder, once the real value "temperature in degrees Celsius" (mnemonic TMPC) has been decoded from a RECCO report within subroutine AF_DRCO, it is immediately stored as follows into the REAL interface values array from within that very same subroutine:

        rivals ( irtmpc ) = (decoded temperature value in °C)
   
Later, after the decoder has finished decoding the entire report, the end-user can then easily access this value within his or her own re-encoding subroutine via the reverse assignment:
        (decoded temperature value in °C) = rivals ( irtmpc )
   
and then store it however he or she wishes. Clearly, the use of these interface pointers adds readability and maintainability to the decoder software itself. For instance, other subroutines which decode and store "temperature in degrees Celsius" for other types of aircraft reports (e.g. AMDAR, AIREP, etc.) can use this same pointer name without each having to know that the pointer really points to rivals array index number 5. In addition, the pointers also facilitate the use of the decoded values by the end-user, who doesn't have to be concerned with the actual storage position of each value within the values array nor even with which subroutine actually decoded the value. Again, the underlying goal was to provide an easy-to-use method of access to the decoded values in order to allow multiple, independent end-users to re-encode them into any final format of their own choosing.

In cases of multi-level data, whereby one or more mnemonics are repeated one or more times (e.g. levels of pressure, temperature, and wind in a rawinsonde report) these data are stored in the interface format by dimensioning the pointers themselves for these mnemonics into arrays and then adding one additional mnemonic describing the actual number of levels stored. For example, in the aircraft decoder interface format, up to 5 layers of turbulence data can be decoded and stored for each aircraft report, and an end-user would access them using logic similar to the following:

        ntrb = INT ( rivals ( irntrb ) )
        IF  ( ntrb .gt. 0 )  THEN
            DO ii = 1, ntrb
                (decoded DGOT for iith layer) = rivals ( irdgot (ii) )
                (decoded HBOT for iith layer) = rivals ( irhbot (ii) )
                (decoded HTOT for iith layer) = rivals ( irhtot (ii) )
                (decoded FQOT for iith layer) = rivals ( irfqot (ii) )
                (decoded TPOT for iith layer) = rivals ( irtpot (ii) )
            END DO
        END IF
  
where irdgot is the pointer for mnemonic DGOT ("degree of turbulence"), irhbot and irhtot are the pointers for, respectively, the mnemonics HBOT and HTOT ("height of base of turbulence" and "height of top of turbulence"), irfqot is the pointer for mnemonic FQOT ("frequency of turbulence"), irtpot is the pointer for mnemonic TPOT ("type of turbulence") and irntrb is the pointer for mnemonic NTRB ("total number of turbulence layers stored"). Thus, each pass through the DO loop returns one of the ntrb layers of decoded turbulence data.

Whenever a particular interface format value is unavailable or unable to be decoded from within a particular report, this is indicated by the use of an appropriate default value to denote "missing" for the related mnemonic. For multi-level "counter" mnemonics, such as the above NTRB ("total number of turbulence layers stored"), the intuitive value of "0" is used to indicate that there are no such levels or layers available for the report in question. However, for all other REAL mnemonics, the default value of "-9999.0" is used to denote "missing". And for CHARACTER mnemonics, the corresponding value is set to all blanks in order to denote "missing". For example, if a particular AMDAR report did not contain a relative humidity observation, then the interface value rivals(irrelh) would be set to -9999.0, denoting that the corresponding mnemonic RELH ("relative humidity") was missing for that report. Similarly, if a particular PIREP report did not contain a valid aircraft type indicator, then the interface value civals(icactp) would be set to all blanks, indicating that the corresponding mnemonic ACTP ("aircraft type") was missing for that report.

With this in mind, we are now ready to look at the full implementation of the interface format (encompassing all single and multi-level REAL and CHARACTER data) for the aircraft decoder:

        PARAMETER       ( MXNLYR = 5 )
C*                                      Maximum number of layers of icing,
C*                                      turbulence, or cloud/sky cover data
C*                                      that will be decoded from a PIREP
C*                                      or RECCO report
C*
        PARAMETER       (     MNM1 = ( MXNLYR - 1 ),
     +                      MNM1T3 = ( MNM1 * 3 ),
     +                      MNM1T4 = ( MNM1 * 4 ),
     +                      MNM1T5 = ( MNM1 * 5 )     )  
C*
        PARAMETER       ( MXWLYR = 3 )
C*                                      Maximum number of layers of present
C*                                      weather data that will be decoded
C*                                      from a PIREP or RECCO report
C*
        PARAMETER       (     MWM1 = ( MXWLYR - 1 ),
     +                      MWM1T2 = ( MWM1 * 2 )     )  
C*
        PARAMETER       ( NRIMN = 103 )
C*                                      Number of real interface
C*                                      mnemonics
C*
        PARAMETER       ( NRSIMN = 28 )
C*                                      Number of real single-level
C*                                      interface mnemonics
C*
        CHARACTER       rimnem ( NRIMN )*8
	DATA	( rimnem ( i ), i = 1, NRIMN )
     +  /   'SLAT'  , 'SLON'  , 'DRCT'  , 'SKNT'  , 'TMPC'  , 'DWPC'  ,
     +      'RELH'  , 'SSTC'  , 'PMSL'  , 'FLVL'  , 'PSAL'  , 'POAF'  ,
     +      'ACNS'  , 'TADR'  , 'PCAT'  , 'MDEVG' , 'DAYW'  , 'VSBY'  ,
     +	    'YEAR'  , 'MNTH'  , 'DAYS'  , 'HOUR'  , 'MINU'  ,
     +      'WDIR1' , 'WSKT1' ,
     +      'VSIG'  , 'PRES'  , 'HGTM'  ,
     +      'NTRB'  , 'DGOT'  , 'HBOT'  , 'HTOT'  , 'FQOT'  , 'TPOT'  ,
     +                  MNM1T5 * ' ',
     +      'NICG'  , 'AFIC'  , 'HBOI'  , 'HTOI'  , 'TPOI'  ,
     +                  MNM1T4 * ' ',
     +      'NPWX'  , 'HBWX'  , 'HTWX'  ,
     +                  MWM1T2 * ' ',
     +      'NCLD'  , 'CLAM'  , 'CLTP'  , 'HCBF'  , 'HCTF'  ,
     +                  MNM1T4 * ' '    /
C*                                      Real interface mnemonics
C*
        COMMON  / RINTFP /
     +     irslat  , irslon  , irdrct  , irsknt  , irtmpc  , irdwpc  ,
     +     irrelh  , irsstc  , irpmsl  , irflvl  , irpsal  , irpoaf  ,
     +     iracns  , irtadr  , irpcat  , irmdvg  , irdayw  , irvsby  ,
     +	   iryear  , irmnth  , irdays  , irhour  , irminu  ,
     +     irwdr1  , irwsk1  ,
     +     irvsig  , irpres  , irhgtm  ,
     +     irntrb  , irdgot ( MXNLYR ) ,
     +	             irhbot ( MXNLYR ) , irhtot ( MXNLYR ) ,
     +	             irfqot ( MXNLYR ) , irtpot ( MXNLYR ) ,
     +     irnicg  , irafic ( MXNLYR ) ,
     +               irhboi ( MXNLYR ) , irhtoi ( MXNLYR ) ,
     +               irtpoi ( MXNLYR ) ,
     +     irnpwx  , irhbwx ( MXWLYR ) , irhtwx ( MXWLYR ) ,
     +     irncld  , irclam ( MXNLYR ) , ircltp ( MXNLYR ) ,
     +               irhcbf ( MXNLYR ) , irhctf ( MXNLYR )
C*                                      Pointers to relative locations of
C*                                      real interface mnemonics within
C*                                      rimnem ( ).  These pointers will be
C*                                      set by AF_IFSP and then used as
C*                                      indices into the real interface
C*                                      values array rivals ( ).
C*
        REAL            rivals ( NRIMN )
C*
        COMMON  / RINTFV /      rivals
C*                                      Real interface values
C*
        PARAMETER       ( NCIMN = 7 )
C*                                      Number of character interface
C*                                      mnemonics
C*
        CHARACTER       cimnem ( NCIMN )*8
	DATA	( cimnem ( i ), i = 1, NCIMN )
     +  /  'ACID'  , 'ACTP'  , 'RPID'  , 'RSID'  ,
     +     'WCOD'  , MWM1 * ' '  /
C*                                      Character interface mnemonics
C*
        COMMON  / CINTFP /
     +     icacid  , icactp  , icrpid  , icrsid  ,
     +     icwcod ( MXWLYR )
C*                                      Pointers to relative locations of
C*                                      character interface mnemonics within
C*                                      cimnem ( ).  These pointers will be
C*                                      set by AF_IFSP and then used as
C*                                      indices into the character
C*                                      interface values array civals ( )
C*
        CHARACTER       civals ( NCIMN )*8
C*
        COMMON  / CINTFV /      civals
C*                                      Character interface values
  
Note that the REAL and CHARACTER data are stored in separate arrays, but that the multi-level data for each type is stored along with the single-level data of that same type. Note also that the mnemonics for the multi-level data are only listed once in arrays rimnem and cimnem, but that the corresponding pointers are themselves dimensioned into arrays, and appropriate amounts of storage space are maintained with the respective values arrays rivals and civals.

Below is a table listing some of the more common interface format values stored by the NCEP decoders. This list is for illustrative purposes only and should not be interpreted as all-inclusive. For a complete listing of all of the values that are decoded and stored by any one of the decoders, click on the appropriate link following the table.

Mnemonic Description Units Value
STID Station ID CCITT IA5 civals (icstid)
SLAT Station latitude Degrees rivals (irslat)
SLON Station longitude Degrees rivals (irslon)
SELV Station elevation Meters rivals (irselv)
PRES Pressure Millibars rivals (irpres)
PMSL MSL Pressure Millibars rivals (irpmsl)
HGTM Height Meters rivals (irhgtm)
DRCT Wind direction Degrees true rivals (irdrct)
SKNT Wind speed Knots rivals (irsknt)
SPED Wind speed Meters/second rivals (irsped)
WCOD Weather code CCITT IA5 civals (icwcod)
TMPK Temperature Degrees Kelvin rivals (irtmpk)
TMPC Temperature Degrees Celsius rivals (irtmpc)
DWPC Dewpoint temperature Degrees Celsius rivals (irdwpc)
RELH Relative humidity Percent rivals (irrelh)
VSBY Visibility Miles rivals (irvsby)

To view a complete table listing of the interface format output values from any one of the decoders, click on the appropriate link below:



NOAA/ National Weather Service
National Centers for Environmental Prediction
5830 University Research Court
College Park, MD 20740
NCEP Internet Services Team
Disclaimer
Credits
Glossary
Privacy Policy
About Us
Career Opportunities
Page last modified: Wednesday, 17-May-2006 16:42:26 UTC