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

    FILE:  OCEANDAT.DEF
    USAGE: Edit this file to create a producer definition file for CODAS

*/
/*-----------------------------------------------------------------------------

    The DATASET_ID:

    Data set ID is given by 32 characters, where the first 8 are
    used for the instrument name (in this case, the vessel-mounted ADCP's)
    and the rest are currently unassigned and may be used for anything.

        CODE     INSTRUMENT
        -------  ----------
        ADCP-VM  vessel-mounted ADCP
        ADCP-BM  bottom-mounted ADCP
        ADCP-MO  moored ADCP
        XBT      XBT
        CTD      CTD
        CTD-ROS  CTD with bottle samples
        ACOUS_DS acoustic dropsonde (Pegasus, WH)
        IES      inverted echo sounder
        MCM      moored current meter
        SSP      sub-surface pressure gauge
        TIDE     tide gauge

    If what you need is not in the list, make up your own.
    I (Eric Firing) would appreciate being consulted if you
    do this, since I would like to maintain a standard list.

-----------------------------------------------------------------------------*/
DATASET_ID                ADCP-VM
/*-----------------------------------------------------------------------------

    The PRODUCER_ID:

    Producer ID is given by 32 characters:

        2-character country code, 2-character institution code,
        2-character platform code, and 4-character instrument code;
        the rest are currently unassigned and may be used for anything

    Use NODC codes to set your own producer id to replace this:

-----------------------------------------------------------------------------*/
PRODUCER_ID               32R2MW0001
/*-----------------------------------------------------------------------------

    The BLOCK_DIR_TYPE:

    As of now there is just one type of block directory, so
    leave this next line alone:

------------------------------------------------------------------------------*/
BLOCK_DIR_TYPE                  0
/*-----------------------------------------------------------------------------

    The PROFILE_DIR_TYPE:

    Profile directory can be of type:

        0 - only time key is in directory (for fixed installations)
        1 - time and position keys (for moving installations)
        2 - time and depth range keys
        3 - time, position, and depth range keys

    Substitute the number that suits your application:

-----------------------------------------------------------------------------*/
PROFILE_DIR_TYPE                3
/*-----------------------------------------------------------------------------

    The DATA_LIST:

    The following is an attempt to set some standard id numbers for
    common oceanographic data types.  You do not have to use
    this scheme, but using it will help later with data exchange
    and with software development.  Note that the id numbers are
    also given in the C header file, DATA_ID.H.

    If possible, please use these data id numbers, names, and units.
    You are free to change the access_types, value_types, offsets, and scales.

    You can leave all these in, or leave only the ones you
    need, and/or change some of these, and/or define
    your own.  For example, you might want to use id
    numbers above 71 for processed data types that do
    not fit the categories given here.

          access_types are:

          UNUSED      - the data is not part of the database

          PROFILE_VAR - the data varies from profile to profile in the block

          BLOCK_VAR   - the data varies in value/length from one block to
                        another.

          value_types are:

          CHAR    - character type (1 byte)
          BYTE    - signed 1 byte (-128 to +127)
          UBYTE   - unsigned 1 byte (0 to +255)
          SHORT   - signed 2 bytes (-32768 to +32767)
          USHORT  - unsigned 2 bytes (0 to +65535)
          LONG    - signed 4 bytes (-2,147,483,648 to +2,147,483,647)
          ULONG   - unsigned 4 bytes (0 to 4,294,967,295)
          FLOAT   - signed 4 bytes (-1.0e38 to +1.0e38)
          DOUBLE  - signed 8 bytes (-1.0e38 to +1.0e38)
          COMPLEX - 8 bytes: 4-byte real and 4-byte imaginary
          STRUCT  - record-type of any size (elements may be of any value_type)
          TEXT    - null-terminated character string (use CHAR for non-null-
                    terminated character sequences)

     The following are just for an example.  You should include
     whatever you will need for a given dataset.  Remember that
     there is no need to try to include everything imaginable
     in a single dataset, since CODAS gives you easy simultaneous
     access to several separate datasets.

access_type    id  value_type   data_name            offset  scale   units
-----------------------------------------------------------------------------*/
BLOCK_VAR      0  SHORT     DEPTH                0       1       m
UNUSED         1  USHORT    TEMPERATURE          -10     1.E-3   C
UNUSED         2  USHORT    SALINITY             0       1.E-3   ppt
UNUSED         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
UNUSED        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
PROFILE_VAR   32  CHAR      PROFILE_COMMENTS     0       1       none
BLOCK_VAR     33  CHAR      BLOCK_COMMENTS       0       1       none
UNUSED        34  SHORT     PROFILE_FLAGS        0       1       none
BLOCK_VAR     35  STRUCT    CONFIGURATION_1      0       1       none
BLOCK_VAR     36  STRUCT    CONFIGURATION_2      0       1       none
PROFILE_VAR   37  STRUCT    ANCILLARY_1          0       1       none
PROFILE_VAR   38  STRUCT    ANCILLARY_2          0       1       none
PROFILE_VAR   39  STRUCT    ACCESS_VARIABLES     0       1       none
UNUSED        40  SHORT     DEPTH_SAMPLE         0       1       m
UNUSED        41  USHORT    SIGMA_T              0       1.E-3   kg/m3
UNUSED        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
UNUSED        52  USHORT    POTENTIAL_TEMP       -10     1.E-3   C
UNUSED        53  FLOAT     CONDUCTIVITY         0       1       none
PROFILE_VAR   54  SHORT     W                    0       1.E-3   m/s
PROFILE_VAR   55  SHORT     ERROR_VEL            0       1.E-3   m/s
PROFILE_VAR   56  UBYTE     PERCENT_GOOD         0       1       none
PROFILE_VAR   57  UBYTE     PERCENT_3_BEAM       0       1       none
PROFILE_VAR   58  UBYTE     SPECTRAL_WIDTH       0       1       none
PROFILE_VAR   59  SHORT     U_STD_DEV            0       1.E-3   m/s
PROFILE_VAR   60  SHORT     V_STD_DEV            0       1.E-3   m/s
PROFILE_VAR   61  SHORT     W_STD_DEV            0       1.E-3   m/s
PROFILE_VAR   62  SHORT     EV_STD_DEV           0       1.E-3   m/s
PROFILE_VAR   63  BYTE      AMP_STD_DEV          0       1       none
PROFILE_VAR   64  SHORT     RAW_DOPPLER          0       1       none
PROFILE_VAR   65  SHORT     RAW_AMP              0       1       none
PROFILE_VAR   66  STRUCT    RAW_SPECTRAL_WIDTH   0       1       none
PROFILE_VAR   67  UBYTE     BEAM_STATS           0       1       none
PROFILE_VAR   68  STRUCT    NAVIGATION           0       1       none
PROFILE_VAR   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
PROFILE_VAR   75  STRUCT    USER_BUFFER          0       1       none
PROFILE_VAR   76  STRUCT    ADCP_CTD             0       1       none
/*-----------------------------------------------------------------------------

    Structure Definitions:  Enter the definitions for variables
    used above, if any, that are of type STRUCT_VALUE_CODE.  Also,
    if any of their elements are of type STRUCT_VALUE_CODE, enter
    definitions for those elements.

*/
DEFINE_STRUCT  CONFIGURATION_1  23
  ELEM         1  FLOAT     avg_interval                         s
  ELEM         1  SHORT     compensation                         none
  ELEM         1  SHORT     num_bins                             none
  ELEM         1  FLOAT     tr_depth                             m
  ELEM         1  FLOAT     bin_length                           m
  ELEM         1  FLOAT     pls_length                           m
  ELEM         1  FLOAT     blank_length                         m
  ELEM         1  FLOAT     ping_interval                        s
  ELEM         1  SHORT     bot_track                            none
  ELEM         1  SHORT     pgs_ensemble                         none
  ELEM         1  SHORT     ens_threshold                        none
  ELEM         1  SHORT     ev_threshold                         mm/s
  ELEM         1  FLOAT     hd_offset                            deg
  ELEM         1  FLOAT     pit_offset                           deg
  ELEM         1  FLOAT     rol_offset                           deg
  ELEM         1  FLOAT     hd_misalign                          deg
  ELEM         1  FLOAT     pit_misalign                         deg
  ELEM         1  FLOAT     rol_misalign                         deg
  ELEM         1  FLOAT     freq_transmit                        Hz
  ELEM         1  SHORT     top_ref_bin                          none
  ELEM         1  SHORT     bot_ref_bin                          none
  ELEM         1  FLOAT     scale_factor                         none
  ELEM         1  FLOAT     heading_bias                         deg

DEFINE_STRUCT ANCILLARY_1 10
  ELEM         1  FLOAT     tr_temp                              C
  ELEM         1  FLOAT     snd_spd_used                         m/s
  ELEM         1  FLOAT     best_snd_spd                         m/s
  ELEM         1  FLOAT     mn_heading                           deg
  ELEM         1  SHORT     pgs_sample                           none
  ELEM         1  SHORT     unassigned1                          none
  ELEM         1  SHORT     unassigned2                          none
  ELEM         1  SHORT     unassigned3                          none
  ELEM         1  SHORT     unassigned4                          none
  ELEM         1  SHORT     unassigned5                          none

DEFINE_STRUCT ANCILLARY_2 24
  ELEM         1  FLOAT     avg_fwd_speed                        m/s
  ELEM         1  FLOAT     avg_stbd_speed                       m/s
  ELEM         1  FLOAT     std_fwd_speed                        m/s
  ELEM         1  FLOAT     std_stbd_speed                       m/s
  ELEM         1  FLOAT     avg_u_rel                            m/s
  ELEM         1  FLOAT     avg_v_rel                            m/s
  ELEM         1  FLOAT     avg_w_rel                            m/s
  ELEM         1  FLOAT     last_temp                            C
  ELEM         1  FLOAT     last_heading                         deg
  ELEM         1  FLOAT     last_pitch                           deg
  ELEM         1  FLOAT     last_roll                            deg
  ELEM         1  FLOAT     mn_pitch                             deg
  ELEM         1  FLOAT     mn_roll                              deg
  ELEM         1  FLOAT     std_temp                             C
  ELEM         1  FLOAT     std_heading                          deg
  ELEM         1  FLOAT     std_pitch                            deg
  ELEM         1  FLOAT     std_roll                             deg
  ELEM         1  SHORT     ocean_depth                          m
  ELEM         1  SHORT     max_amp_bin                          none
  ELEM         1  SHORT     last_good_bin                        none
  ELEM         1  SHORT     unassigned1                          none
  ELEM         1  SHORT     unassigned2                          none
  ELEM         1  SHORT     unassigned3                          none
  ELEM         1  SHORT     unassigned4                          none

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

DEFINE_STRUCT  BOTTOM_TRACK  3
  ELEM         1  FLOAT     u                                    m/s
  ELEM         1  FLOAT     v                                    m/s
  ELEM         1  FLOAT     depth                                m

DEFINE_STRUCT  NAVIGATION 4
  ELEM         1  DOUBLE   loran_lat                             deg
  ELEM         1  DOUBLE   loran_lon                             deg
  ELEM         1  DOUBLE   loran_vel                             knots
  ELEM         1  DOUBLE   loran_dir                             deg

DEFINE_STRUCT  USER_BUFFER  12
/*
   In line above, set USER_BUFFER 12 for 1281_type, or 10 for 1021_type
*/
  ELEM         1  SHORT    version                               none
/*
   comment out above line if it is 1021_type
*/
  ELEM         1  SHORT    max_avgs                              none
  ELEM         1  SHORT    first_bin                             none
  ELEM         1  SHORT    n_bins                                none
  ELEM        20  SHORT    avg_uv                                mm/s
  ELEM         1  SHORT    set                                   deg*E-1
  ELEM         1  SHORT    drift                                 kts*E-2
  ELEM         1  SHORT    position_source                       none
  ELEM         1  SHORT    dr_time                               s
  ELEM         1  STRUCT   fix                                   none
  ELEM         1  LONG     time                                  s
  ELEM         1  STRUCT   gps_status                            none
/*
   comment out above line if it is 1021_type; also comment out the
   structure definition for GPS_STATUS.
*/

DEFINE_STRUCT  fix  21
  ELEM         1  SHORT    ref_u                                 mm/s
  ELEM         1  SHORT    ref_v                                 mm/s
  ELEM         1  SHORT    ref_count                             none
  ELEM         1  SHORT    sat_id                                none
  ELEM         1  LONG     pc_time                               s
  ELEM         1  LONG     fix_time                              s
  ELEM         1  LONG     lon                                   sec*E-2
  ELEM         1  LONG     lat                                   sec*E-2
  ELEM         1  LONG     antenna                               m*E-1
  ELEM         1  SHORT    dr_dist                               nm*E-2
  ELEM         1  SHORT    dr_dir                                deg*E-1
  ELEM         1  SHORT    sigma_lon                             m
  ELEM         1  SHORT    sigma_lat                             m
  ELEM         1  BYTE     used                                  none
  ELEM         1  BYTE     q1                                    none
  ELEM         1  BYTE     q2                                    none
  ELEM         1  BYTE     q3                                    none
  ELEM         1  BYTE     elevation                             deg
  ELEM         1  BYTE     iterations                            none
  ELEM         1  BYTE     dop_count                             none
  ELEM         1  BYTE     spare                                 none

/*
   The following structure definition is not needed and may be
   commented out if the 1021 user buffer is used.
*/
DEFINE_STRUCT  gps_status 14
  ELEM         1  SHORT   received                               none
  ELEM         1  BYTE    nsat                                   none
  ELEM         1  BYTE    quality                                none
  ELEM         3  BYTE    track_status[3]                        none
  ELEM         1  BYTE    state                                  none
  ELEM         1  BYTE    mode                                   none
  ELEM         1  BYTE    hdop                                   none
  ELEM         1  SHORT   dopN                                   none
  ELEM         1  SHORT   dopE                                   none
  ELEM         1  SHORT   dopV                                   none
  ELEM         1  SHORT   OscBias                                m/s*E-1
  ELEM         1  SHORT   V                                      Kts*E-2
  ELEM         1  SHORT   U                                      Kts*E-2
  ELEM         1  SHORT   altitude                               m*E-1

DEFINE_STRUCT  ADCP_CTD  4
  ELEM         1  STRUCT   last_count                            none
  ELEM         1  STRUCT   ensemble_total                        none
  ELEM         1  STRUCT   session_total                         none
  ELEM       -16  STRUCT   unused                                none

DEFINE_STRUCT  last_count  4
  ELEM         1  LONG     conductivity                          none
  ELEM         1  LONG     temperature                           deg
  ELEM         1  LONG     depth                                 m
  ELEM         1  LONG     time                                  none

DEFINE_STRUCT  ensemble_total 4
  ELEM         1  LONG     conductivity                          none
  ELEM         1  LONG     temperature                           deg
  ELEM         1  LONG     depth                                 m
  ELEM         1  LONG     time                                  none

DEFINE_STRUCT  session_total 4
  ELEM         1  LONG     conductivity                          none
  ELEM         1  LONG     temperature                           deg
  ELEM         1  LONG     depth                                 m
  ELEM         1  LONG     time                                  none
