
/******************************************************************************

  FILE:  con2db.def

         This producer definition file is used with the [[con2db]] utility
         to load data from a contour file into a CODAS database.

-------------------------------------------------------------------------------
  PRODUCER DEFINITION FILE STRUCTURE:

  DATASET_ID        < insttype________________________ >
                    { a 32-character string, where the first 8 chars.
                      indicate the type of instrument, e.g., ADCP-VM,
                      and the remainder can be used for anything }
  PRODUCER_ID       < cciippinst______________________ >
                    { a 32-character string, where cc = 2-char. NODC country
                      code, ii = 2-char. NODC institution code, pp = 2-char.
                      NODC platform code, inst = 4-char. instrument ID (unique
                      to site), and the remainder can be used for anything }
  BLOCK_DIR_TYPE    < 0 >
                    { block directory can have one or more keys;
                      currently there is only one type = 0 (time) }
  PROFILE_DIR_TYPE  < 0 | 1 | 2 | 3 >
                    { profile directory can have one or more keys,
                      depending on the nature of the data collected:
                      0 = time only (for fixed installations)
                      1 = time and position (moving installations)
                      2 = time and depth range
                      3 = time, position, and depth range }

  { data type definition(s), one for each variable to be loaded: }
  < freq > < id > < value_type > < data_name > < offset > < scale > < units >
  .
  .
  .
    { where       freq = < BLOCK_VAR | PROFILE_VAR | UNUSED >
                         refering to how often the data item will be loaded:
                         BLOCK_VAR   = once per block file
                                       (data varies only from block to block)
                         PROFILE_VAR = once per profile
                                       (data varies from profile to profile)
                         UNUSED      = not loaded at all
                    id = unique numeric code associated with the data item
            value_type = < BYTE | UBYTE | SHORT | ... >    (see below)
                         choose the type that minimizes storage requirements
                         but is sufficient to accommodate the range of values
                         that type can assume:

                         Value   Bytes of                Value
                         Type    Storage                 Range
                         -----   --------   ---------------------------------
                         BYTE       1                 -128 to +127
                         UBYTE      1                    0 to +255
                         SHORT      2               -32768 to +32767
                         USHORT     2                    0 to +65535
                         LONG       4       -2,147,483,648 to +2,147,483,647
                         ULONG      4                    0 to +4,294,967,295
                         FLOAT      4              -1.0e38 to +1.0e38
                         DOUBLE     8              -1.0e38 to +1.0e38
                         CHAR       1                printable ASCII
                         TEXT       1                printable ASCII
                         STRUCT  variable          depends on elements
             data_name = name of data item (max. 20 chars., no spaces)
                offset = a constant amount to add (subtract) to the data values
                         when storing (retrieving); useful when a data item
                         can be squeezed into a smaller value_type by
                         performing this offset; set to 0 if no offset
                 scale = a scaling factor to apply to the data values when
                         storing and retrieving; useful when a data item
                         can be squeezed into a smaller value_type by
                         scaling; set to 1 if no scaling
                 units = mks units (12 chars. or less) or "none" if unit-less }

  { structure defintion(s), one for each STRUCT-type variable to be loaded: }
  [ DEFINE_STRUCT <struct_name> <no. of elements>
      ELEM <no. of instances> <value type> <element name> <units>
      .
      .
      .
      ]
  .
  .
  .
    { where struct_name = name of data item that is of STRUCT type
                          (exactly as it appears in data definition section)
        no. of elements = no. of ELEM lines that immediately follow
       no. of instances = how many such ELEM (1 if single-valued; >1 if array)
             value type = < BYTE | UBYTE | SHORT | ... > (see above)
           element name = name unique within the structure definition
                          max. 20 characters, no spaces
                  units = mks unit (12 chars. or less) or "none" if unit-less }
-----------------------------------------------------------------------------*/

DATASET_ID         CONTOUR
PRODUCER_ID        5810AA; Pierre Jaccard
BLOCK_DIR_TYPE     0
PROFILE_DIR_TYPE   3          /* time, position, and depth range keys */
/*
        DATA DEFINITION FOR ADCP DATA

frequency     id value_type  data_name         offset  scale  units
*/
BLOCK_VAR      0  SHORT     DEPTH                0       1       m
PROFILE_VAR    1  USHORT    TEMPERATURE          -10     1.E-3   C
PROFILE_VAR    2  USHORT    SALINITY             0       1.E-3   ppt
PROFILE_VAR    3  USHORT    OXYGEN               0       1.E-3   ppt
UNUSED         6  STRUCT    OPTICS               0       1       none
PROFILE_VAR    7  UBYTE     AMP_SOUND_SCAT       0       1       none
PROFILE_VAR    8  SHORT     U                    0       1.E-3   m/s
PROFILE_VAR    9  SHORT     V                    0       1.E-3   m/s
PROFILE_VAR		10  SHORT     P                    0       1       dbar
UNUSED        11  STRUCT    TEMP_SAMPLE          0       1       none
UNUSED        12  USHORT    SALINITY_SAMPLE      0       1.E-3   ppt
UNUSED        13  USHORT    OXYGEN_SAMPLE        0       1.E-3   ppt
UNUSED        14  STRUCT    NUTRIENT_SAMPLE      0       1       none
UNUSED        15  STRUCT    TRACER_SAMPLE        0       1       none
UNUSED        20  SHORT     OCEAN_DEPTH          0       1       m
UNUSED        21  STRUCT    WEATHER              0       1       none
UNUSED        22  STRUCT    SEA_SURFACE          0       1       none
UNUSED        32  CHAR      PROFILE_COMMENTS     0       1       none
BLOCK_VAR     33  CHAR      BLOCK_COMMENTS       0       1       none
PROFILE_VAR   34  UBYTE     PROFILE_FLAGS        0       1       none
UNUSED				35  STRUCT    CONFIGURATION_1      0       1       none
UNUSED				36  STRUCT    CONFIGURATION_2      0       1       none
UNUSED				37  STRUCT    ANCILLARY_1          0       1       none
UNUSED				38  STRUCT    ANCILLARY_2          0       1       none
PROFILE_VAR   39  STRUCT    ACCESS_VARIABLES     0       1       none
UNUSED        40  SHORT     DEPTH_SAMPLE         0       1       m
PROFILE_VAR   41  USHORT    SIGMA_T              0       1.E-3   kg/m3
PROFILE_VAR   42  USHORT    SIGMA_THETA          0       1.E-3   kg/m3
UNUSED        43  USHORT    SIGMA_Z              0       1.E-3   kg/m3
UNUSED        44  USHORT    SIGMA_2              0       1.E-3   kg/m3
UNUSED        45  USHORT    SIGMA_4              0       1.E-3   kg/m3
UNUSED        46  USHORT    SPEC_VOL_ANOM        0       1.E-9   m3/kg
UNUSED        47  USHORT    THERMOSTERIC_ANOM    0       1.E-9   m3/kg
UNUSED        48  SHORT     DYNAMIC_HEIGHT       0       1.E-3   dyn_m
UNUSED        49  SHORT     BVF                  0       1.E-5   /s
UNUSED        50  SHORT     SOUNDSPEED           1500    1.E-2   m/s
UNUSED        51  SHORT     TIME_FROM_START      0       1       s
PROFILE_VAR   52  USHORT    POTENTIAL_TEMP       -10     1.E-3   C
PROFILE_VAR   53  FLOAT     CONDUCTIVITY         0       1       none
PROFILE_VAR   54  SHORT     W                    0       1.E-3   m/s
UNUSED        55  SHORT     ERROR_VEL            0       1.E-3   m/s
UNUSED        56  UBYTE     PERCENT_GOOD         0       1       none
UNUSED        57  UBYTE     PERCENT_3_BEAM       0       1       none
PROFILE_VAR   58  SHORT     SPECTRAL_WIDTH       0       1.E-4   m/s
UNUSED        59  SHORT     U_STD_DEV            0       1.E-3   m/s
UNUSED				60  SHORT     V_STD_DEV            0       1.E-3   m/s
UNUSED        61  SHORT     W_STD_DEV            0       1.E-3   m/s
UNUSED        62  SHORT     EV_STD_DEV           0       1.E-3   m/s
/* PROFILE_VAR   63  BYTE      AMP_STD_DEV          0       1       none 
	 98.03.30 PJ 
	 Changed the type of AMP_STD_DEV to UBYTE */
UNUSED				63  UBYTE     AMP_STD_DEV          0       1       none 
UNUSED				64  SHORT     RAW_DOPPLER          0       1       none
UNUSED				65  UBYTE     RAW_AMP              0       1       none
UNUSED				66  UBYTE     RAW_SPECTRAL_WIDTH   0       1       none
UNUSED				67  UBYTE     BEAM_STATS           0       1       none
UNUSED				68  STRUCT    NAVIGATION           0       1       none
UNUSED				69  STRUCT    BOTTOM_TRACK         0       1       none
UNUSED        70  SHORT     U_LOG                0       1.E-3   m/s
UNUSED        71  SHORT     V_LOG                0       1.E-3   m/s
UNUSED        75  STRUCT    USER_BUFFER          0       1       none
UNUSED        76  STRUCT    ADCP_CTD             0       1       none

/*
     STRUCTURE DEFINITIONS
*/

DEFINE_STRUCT  ACCESS_VARIABLES  8
  ELEM         1  SHORT     first_good_bin                       none
  ELEM         1  SHORT     last_good_bin                        none
  ELEM         1  FLOAT     U_ship_absolute                      m/s
  ELEM         1  FLOAT     V_ship_absolute                      m/s
  ELEM         1  SHORT     user_flag_1                          none
  ELEM         1  SHORT     user_flag_2                          none
  ELEM         1  SHORT     user_flag_3                          none
  ELEM         1  SHORT     user_flag_4                          none

