  UDCF - Universal Dive Computer Format
  Kai Schroeder <kai@streit.cc> and Steffen Reith
  <streit@streit.cc>,
  2002/02/16

  The interchangeability of the various formats of dive profiles of dif-
  ferent dive computer and dive simulation programs is the purpose of
  UDCF. With it it's possible to analyse a "real" dive profile recorded
  by an arbitrary dive computer after conversion into UDCF on an arbi-
  trarily chosen computer system or to recalculate this profile using a
  different decompression model, respectively.
  ______________________________________________________________________

  Table of Contents




















































  1. Structure of UDCF Files

  2. Elements of UDCF (in alphabetical order)

     2.1 <acv> ... </acv>   (optional)
     2.2 <addinfo> ... </addinfo>   (optional)
     2.3 <alarm> ... </alarm>   (optional)
     2.4 <altitude> ... </altitude>   (prescribed)
     2.5 <d> ... </d>   (prescribed)
     2.6 <datatrak> ... </datatrak>   (optional)
     2.7 <date> ... </date>   (prescribed)
     2.8 <day> ... </day>   (prescribed)
     2.9 <delta> ... </delta>   (prescribed)
     2.10 <deltamode/>   (prescribed)
     2.11 <density> ... </density>   (prescribed)
     2.12 <device> ... </device>   (prescribed)
     2.13 <dive> ... </dive>   (prescribed)
     2.14 <gases> ... </gases>   (prescribed)
     2.15 <he> ... </he>   (prescribed)
     2.16 <hour> ... </hour>   (prescribed)
     2.17 Comments
     2.18 <minute> ... </minute>   (prescribed)
     2.19 <mix> ... </mix>   (prescribed)
     2.20 <mixname> ... </mixname>   (prescribed)
     2.21 <model> ... </model>   (prescribed)
     2.22 <month> ... </month>   (prescribed)
     2.23 <n2> ... </n2>   (prescribed)
     2.24 <o2> ... </o2>   (prescribed)
     2.25 <pend> ... </pend>   (optional)
     2.26 <persinfo> ... </persinfo>   (optional)
     2.27 <place> ... </place>   (optional)
     2.28 <profile udcf="1"> ... </profile>   (prescribed)
     2.29 <program> ... </program>   (optional)
     2.30 <pstart> ... </pstart>   (prescribed)
     2.31 <repgroup> ... </repgroup>   (prescribed)
     2.32 <samples> ... </samples>   (prescribed)
     2.33 <serialid> ... </serialid>   (optional)
     2.34 <surfaceinterval> ... </surfaceinterval>   (prescribed)
     2.35 <switch> ... </switch>   (prescribed)
     2.36 <t> ... </t>   (prescribed)
     2.37 <tank> ... </tank>   (optional)
     2.38 <tankvolume> ... </tankvolume>   (optional)
     2.39 <tausim> ... </tausim>   (optional)
     2.40 <temperature> ... </temperature>   (optional)
     2.41 <time> ... </time>   (prescribed)
     2.42 <timedepthmode/>   (prescribed)
     2.43 <totaldives> ... </totaldives>   (optional)
     2.44 <units> ... </units>   (prescribed)
     2.45 <vendor> ... </vendor>   (prescribed)
     2.46 <version> ... </version>   (prescribed)
     2.47 <work> ... </work>   (optional)
     2.48 <year> ... </year>   (prescribed)

  3. A grammar for UDCF



  ______________________________________________________________________

  11..  SSttrruuccttuurree ooff UUDDCCFF FFiilleess

  An UDCF file consists of different (groups of) elements and keywords,
  which clearly describe a dive profile and the affiliated recording
  dive computer or the program used to generate it. With it a necessary
  sequence is prescribed. Some elements or keywords, respectively, are
  optional and are dropped depending on the dive computer or simulation
  program used. The intention with the development of UDCF was to
  provide a simple, easy-to-use and powerful format for the
  interchangeability of dive data.  For the sake of simplification of
  the programming of parser UDCF was developed in such a manner, that
  current XML parser can be used.

  In the following the elements and keywords are described.

  The general setting up of an UDCF file is as follows:


  1. file header

  2. details about the used system of units (SI, metric or imperial,
     respectively)

  3. data about the recording dive computer or the generating program
     (vendor, model, serial number), respectively

  4. additional information (optional)

  5. the dive profile describing general data, such as place (optional),
     date, time, surface interval, minimum water temperature (optional),
     densitiy of water, height above sealevel of entrance, and
     instructions about the breathing gases used. In case of an air
     consumption calculation (optional) some more instructions must be
     given, such as tankvolume and fill pressure at beginning and end of
     dive.

  6. specific data necessary for the dive computer or simulation
     program, but which are not necessary to show the profile or
     calculate tissue saturation (optional)

  7. time and depth statements or just depth statements when using a
     constant recording interval (which can change during the dive), and
     (optionally) warnings given by the recording dive computer

  8. end of file

  UDCF supports the storing of several dive profiles inside one file.
  The points 5., 6., and 7. then repeat. An UDCF file cannot contain
  profiles of different dive computers or simulation programs,
  respectively.



  22..  EElleemmeennttss ooff UUDDCCFF ((iinn aallpphhaabbeettiiccaall oorrddeerr))

  22..11..  <<aaccvv>> ...... <<//aaccvv>>   ((ooppttiioonnaall))

  Indicates the breathing gas consumption volume for this breathing gas.

  Last statement inside the <``mix''> section.

  Example: see <``tank''>



  22..22..  <<aaddddiinnffoo>> ...... <<//aaddddiinnffoo>>   ((ooppttiioonnaall))

  Additional (optional) information is bracketed with <addinfo>.

  Elements inside <addinfo> are: <``persinfo''>, <``totaldives''>, and
  <``serialid''>.


  Stands in the file header after the <``device''> section and before
  <repgroup>.

  Example:




                  <!-- previous statements -->
                  </device>
                  <addinfo>
                    <persinfo>+49-931-123456</persinfo>
                    <totaldives>124</totaldives>
                    <serialid>71.60.66</serialid>
                  </addinfo>
                  <repgroup>
                  <!-- following statements -->





  22..33..  <<aallaarrmm>> ...... <<//aallaarrmm>>   ((ooppttiioonnaall))

  Warnings of the recording dive computer. At the time the following
  keywords are recognized:



                   keyword          announcement of dive computer
               -----------------------------------------------------------------
                   rbt              remaining bottom time exceeded
                   error            general error (deco stop missed, etc.)
                   ascent           ascent too fast
                   deco             announcement of a deco stop
                   breath           breathing frequency too high
                   surface          surface reached




  Stands inside the <``samples''> section after the belonging depth
  statement. Various warnings can follow after one depth statement.

  Example: see 2. example <``samples''>



  22..44..  <<aallttiittuuddee>> ...... <<//aallttiittuuddee>>   ((pprreessccrriibbeedd))

  Height above sealevel of the entrance given as a real number with one
  digit after decimalcomma.

  Stands inside the <``dive''> section after <``density''> as the last
  statement before the <``gases''> section.

  Example:




                    <!-- height above sealevel 800m (Walchensee - a lake in the Bavarian alps) -->
                    <altitude>800.0</altitude>



  22..55..  <<dd>> ...... <<//dd>>   ((pprreessccrriibbeedd))

  Depth statement given as a real number in Meter (SI, metric) or feet
  (imperial), respectively.

  Stands inside the <``''> section.

  The first and last depth statement inside a dive profile must be
  <d>0.0</d>, because every dive begins and ends at the surface at a
  depth of 0m (but in Datatrak files, for example, a dive profile does
  not begin at 0m :-) )

  Example: see <``samples''>


  22..66..  <<ddaattaattrraakk>> ...... <<//ddaattaattrraakk>>   ((ooppttiioonnaall))

  Inside this section specific information concerning the data format
  used by Aladin dive computers manufactured by Uwatec are given. At
  time the following elements are used:

  +o  <tissues> - the number of compartments included (8 in all Aladin
     dive computers)

  +o  <ip> - the initial pressure saturation at beginning of dive. The
     first statement gives the saturation of the fastest, the last
     statement gives the saturation of the slowest tissue. There are two
     bytes reserved per tissue.  Because the coding isn't known in
     detail at time, only the decimal values of the two bytes are given
     separated by spaces.

  Stands inside the optional <``program''> section as the only
  statement.

  example:



                 <!-- previous statements -->
                 </gases>
                 <program>
                   <datatrak>
                     <tissues>8</tissues>
                     <!-- 2 bytes per tissue, not decoded yet -->
                     <ip> 95  11</ip>
                     <ip>103  11</ip>
                     <ip>107  11</ip>
                     <ip>110  11</ip>
                     <ip>224  11</ip>
                     <ip>156  12</ip>
                     <ip>122  12</ip>
                     <ip>212  11</ip>
                   </datatrak>
                 </program>
                 <deltamode/>
                 <samples>
                 <!-- here profile data -->





  22..77..  <<ddaattee>> ...... <<//ddaattee>>   ((pprreessccrriibbeedd))

  The date at which the dive was performed or the profile was generated
  by a program, respectively.
  The elements inside <date> are: <``year''>, <``month''> and <``day''>,
  exactly in this order.

  Stands inside the <``day''> section after <``place''> (if given) and
  before <``time''>.

  Example:




                 <profile udcf="1">
                 <!-- here statements about units used and manufacturer -->
                 <repgroup>
                   <dive>
                     <!-- here statements about place, if known  -->
                     <!-- date April 6th, 1999 -->
                     <date><year>1999</year><month>4</month><day>6</day></date>
                     <!-- here more statements -->
                   </dive>
                 <!-- following statements -->
                 </profile>





  22..88..  <<ddaayy>> ...... <<//ddaayy>>   ((pprreessccrriibbeedd))

  The day of the month, in which the dive was performed or the profile
  was generated by a program, respectively, given as an integer number.

  Stands inside <``date''>. The sequence is <``year''>, <``month''>,
  <``day''>.

  Example: see <``date''>



  22..99..  <<ddeellttaa>> ...... <<//ddeellttaa>>   ((pprreessccrriibbeedd))

  Indicates the time interval, with which the subsequent depth
  statements were recorded. This statement is active after the following
  depth statement.

  <delta> is the first statement inside the <``samples''> section, if
  switched to <``deltamode/''> before; it is allowed to appear as often
  as necessary inside the <``samples''> section.

  Example: see 2. example <``samples''>


  22..1100..  <<ddeellttaammooddee//>>   ((pprreessccrriibbeedd))

  Indicates that inside the <``samples''> section follow only depth
  statements (with constant time interval).

  Stands directly before the <``samples''> statement.  See also
  <``timedepthmode/''>.

  When using <``deltamode/''> it's necessary that the first statement
  inside the following <``samples''> section is a <``delta''> statement
  to provide the recording time interval.

  Example:  see <``samples''>

  22..1111..  <<ddeennssiittyy>> ...... <<//ddeennssiittyy>>   ((pprreessccrriibbeedd))

  Density of water.

  Stands inside the <``dive''> section after <``temperature''> and
  before <``altitude''>.

  Pure freshwater has a density of 1000.0 kg/m^3, whereas the mean
  density of seawater (saltwater) is 1030.0 kg/m^3.

  Examples:



                    <!-- saltwater -->
                    <density>1030.0</density>







                    <!-- freshwater -->
                    <density>1000.0</density>





  22..1122..  <<ddeevviiccee>> ...... <<//ddeevviiccee>>   ((pprreessccrriibbeedd))

  Inside this section the information about the manufacturer of the
  recording dive computer or the generating program, respectively, are
  bracketed.

  The elements inside <device> are: <``vendor''>, <``model''>, and
  <``version''>, in this order.

  Belongs to the file header and stands after the <``units''> statement.

  Example:




                 <profile udcf="1">
                 <units>metric</units>
                 <device>
                   <vendor>Suunto</vendor>
                   <model>EON</model>
                   <version>1</version>
                 </device>
                 <!-- here more statements  -->
                 </profile>






  22..1133..  <<ddiivvee>> ...... <<//ddiivvee>>   ((pprreessccrriibbeedd))

  inside a <``repgroup''> section the data for a specific profile are
  bracketed inside the <dive> section. When there are several dive
  profiles inside a lt;``repgroup''> section each profile is capsuled by
  <dive>. In this case several <dive> sections follow each other.

  The elements, with which a dive profile is clearly described are as
  follows: <``place''>, <``date''>, <``time''>, <``surfaceinterval''>,
  <``temperature''>,<``density''>, <``altitude''>, <``gases''>,
  <``program''>, and <``samples''>.

  Example:




                 <profile udcf="1">
                 <!-- here information about the units used and the manufacturer  -->
                 <repgroup>
                   <dive>
                     <place>Illes Medes, coast, arch (Costa Brava, Spain)</place>
                     <date><year>1999</year<month>4</month><day>6</day>></date>
                     <time><hour>16</hour><minute>21</minute></time>
                     <surfaceinterval>293.0</surfaceinterval>
                     <temperature>12.0</temperature>
                     <density>1030.0</density>
                     <altitude>0.0</altitude>
                     <gases>
                       <!-- here information about the breathing gases used  -->
                     </gases>
                     <program>
                       <!-- here dive computer- or program-specific data -->
                     </program>
                     <samples>
                       <!-- here time/depth statements describing the profile -->
                     </samples>
                   </dive>
                   <dive>
                     <!-- place, date, time, breathing gases, profile data -->
                   </dive>
                   <!-- here can follow more dive profiles  -->
                 </repgroup>
                 </profile>





  22..1144..  <<ggaasseess>> ...... <<//ggaasseess>>   ((pprreessccrriibbeedd))

  inside this section the breathing gases used (one or more) are
  specified. For each gas used a several <``mix''> section must be
  given.

  The <gases> section stands inside the <``dive''> section after
  <``altitude''> and before <``program''>.

  Example:












               <!-- previous statements of the UDCF file -->
               <altitude>0.0</altitude>
               <gases>
                 <!-- first breathing gas used -->
                 <mix>
                   <mixname>air</mixname>
                   <tank>
                     <!-- here additionally the tankvolume can be given -->
                     <pstart>20000000.0</pstart>
                     <pend>10400000.0</pend>
                   </tank>
                   <o2>0.21</o2>
                   <n2>0.79</n2>
                   <he>0.0</he>
                   <!-- here additionally the gas consumption volume can be given -->
                 </mix>
                 <!-- second gas used -->
                 <mix>
                  <!-- spezification of the second breathing gas -->
                 </mix>
                 <!-- here more breathing gases can follow -->
               </gases>
               <program>
               <!-- here follow more statements -->






  22..1155..  <<hhee>> ...... <<//hhee>>   ((pprreessccrriibbeedd))

  The fraction of Helium in the breathing gas, given as a real number
  less or equal 1.0 in percent (of volume).

  Stands inside the <``mix''> section after <``n2''> and before
  <``acv''> (if given).

  Example:



                    <-- fraction of 90% Helium -->
                    <he>0.9</he>





  22..1166..  <<hhoouurr>> ...... <<//hhoouurr>>   ((pprreessccrriibbeedd))

  The full hour at which the dive is performed or the profile is
  generated by a program, respectively, given as an integer number.

  Stands inside the <``time''> section. The prescribed order is <hour>,
  <``minute''>.

  Example: see <``time''>



  22..1177..  CCoommmmeennttss

  At arbitrarily chosen positions comments can be inserted. A comment
  begins with the characters "<!--" and ends with "-->". In between this
  arbitrarily chosen strings are possible (carriage return, too).
  Example: <!-- This is a comment. -->



  22..1188..  <<mmiinnuuttee>> ...... <<//mmiinnuuttee>>   ((pprreessccrriibbeedd))

  The minutes of the hour at which the dive was performed or the profile
  was generated by a program, respectively, given as an integer number.

  Stands inside the <``time''> section. The prescribed order is
  <``hour''>, <minute>.

  Example: see <``time''>



  22..1199..  <<mmiixx>> ...... <<//mmiixx>>   ((pprreessccrriibbeedd))

  The statements bracketed by <mix> define a breathing gas used. When
  more than one gas is used, several <mix> sections follow each other.

  The elements which clearly define a breathing gas are as follows:
  <``mixname''>, <``tank''>, <``o2''>, <``n2''>, <``he''>, and
  <``acv''>.

  Stands inside the <``gases''> section.

  Example: see <``gases''>



  22..2200..  <<mmiixxnnaammee>> ...... <<//mmiixxnnaammee>>   ((pprreessccrriibbeedd))

  The unambiguous name of a breathing gas.

  To switch to a specific breathing gas inside the <``samples''> section
  this name is used by the statement <``switch''>.

  <mixname> is the first element inside the <``mix''> section.

  Example: see <``gases''>



  22..2211..  <<mmooddeell>> ...... <<//mmooddeell>>   ((pprreessccrriibbeedd))

  inside <model> the model of the recording dive computer or the name of
  the generating program, respectively, is given.

  Stands inside the <``device''> section after <``vendor''> and before
  <``version''>.

  Example: see <``device''>



  22..2222..  <<mmoonntthh>> ...... <<//mmoonntthh>>   ((pprreessccrriibbeedd))

  The month in which the dive was performed or the profile was generated
  by a program, respectively, given as an integer number.

  Stands inside the <``date''> section. The prescribed order is
  <``year''>, <``month''>, <``day''>.

  Example: see <``date''>

  22..2233..  <<nn22>> ...... <<//nn22>>   ((pprreessccrriibbeedd))

  The fraction of nitrogen in the breathing gas, given as a real number
  less or equal 1.0 in percent (of volume).

  Stands inside the <``mix''> section after <``o2''> and before
  <``he''>.

  Example:



                    <mixname>my_nitrox</mixname>
                    <tank>
                       <!-- information for the gas consumption calculation -->
                    </tank>
                    <!-- oxygen fraction 37,5% -->
                    <o2>0.375</o2>
                    <n2>0.625</n2>
                    <he>0.0</he>





  22..2244..  <<oo22>> ...... <<//oo22>>   ((pprreessccrriibbeedd))

  The fraction of nitrogen in the breathing gas, given as a real number
  less or equal 1.0 in percent (of volume).

  Stands inside the <``mix''> section after <``mixname''> and <``tank''>
  (if given) and before <``n2''>.

  Example:



                    <mixname>my_nitrox</mixname>
                    <tank>
                       <!-- information for the gas consumption calculation -->
                    </tank>
                    <!-- oxygen fraction 37,5% -->
                    <o2>0.375</o2>
                    <n2>0.625</n2>
                    <he>0.0</he>





  22..2255..  <<ppeenndd>> ...... <<//ppeenndd>>   ((ooppttiioonnaall))

  Fill pressure of tank at the end of dive.

  Stands (if given) inside the optional <``tank''> section as the last
  statement after <``pstart''>.

  Example: see <tank>



  22..2266..  <<ppeerrssiinnffoo>> ...... <<//ppeerrssiinnffoo>>   ((ooppttiioonnaall))

  Here some personal information can be given, if wanted.


  Stands inside the (optional) <``addinfo''> section as the first
  statement (if given).

  Example: see <``addinfo''>



  22..2277..  <<ppllaaccee>> ...... <<//ppllaaccee>>   ((ooppttiioonnaall))

  The place where the dive was performed - if known.

  If the place is known, <place> is the first statement inside the
  <``dive''> section, otherwise it is dropped.

  Example:



                 <profile udcf="1">
                 <!-- here some general statements   -->
                   <dive>
                     <place>Illes Medes, coast, arch (Costa Brava, Spain)</place>
                     <!-- here more statements -->
                   </dive>
                 <!-- here more statements -->
                 </profile>





  22..2288..  <<pprrooffiillee uuddccff==""11"">> ...... <<//pprrooffiillee>>   ((pprreessccrriibbeedd))

  Each UDCF file begins with <profile udcf="1"> and ends with </profile>
  as the last statement. In between these all other statements are
  given.


  22..2299..  <<pprrooggrraamm>> ...... <<//pprrooggrraamm>>   ((ooppttiioonnaall))

  Program specific information, which is necessary for the calculation
  of the tissue saturation or internal parameters for the graphical
  presentation of data, respectively, are bracketed inside <program>.

  The data between <program> and </program> are not analysed by an UDCF
  parser, but are forwarded to the calling program. This allows to
  provide specific meta-information, which are unknown to UDCF. The only
  convention is, that every program has to place its meta-information
  inside <program> and </program>.

  Note for programmers: please document how tissue saturation parameters
  or other important information are provided in your <program> section
  to allow other programs to correctly read and interpret the data!

  At the time the following keywords are supported: <``datatrak''>,
  <``tausim''>.

  <program> stands inside the <``dive''> section after the <``gases''>
  and before the <``samples''> section.

  Example: see <``datatrak''> and <``tausim''>





  22..3300..  <<ppssttaarrtt>> ...... <<//ppssttaarrtt>>   ((pprreessccrriibbeedd))

  Fill pressure of tank at the beginning of dive.

  Stands inside the optional <``tank''> section after <``tankvolume''>
  (if given) and before <``pend''> (if given).

  Opposite to <``tankvolume''> or <``pend''>, which can be given
  alternatively, <pstart> must always be given inside the <``tank''>
  section. Otherwise a gas consumption calculation wouldn't be possible.

  Example: see <``tank''>


  22..3311..  <<rreeppggrroouupp>> ...... <<//rreeppggrroouupp>>   ((pprreessccrriibbeedd))

  With <repgroup> "related dives" are grouped together. Here "related
  dives" means, that all the dives have a finite surface interval
  (except the first one) and were all performed during a holiday, for
  example. The single dives inside <repgroup> are devided from each
  other by the element <``dive''>.

  Several <repgroup> sections can appear directly after each other.
  Inside a <repgroup> section at least one dive must appear. The first
  dive in a <repgroup> section should show an "infinite" surface
  interval.


  Example:



                 <profile udcf="1">
                 <!-- here statements concerning units and the manufacturer -->
                 <repgroup>
                   <dive>
                     <!-- here information concerning the first dive  -->
                     <!-- (should show an infinite surface interval)  -->
                   </dive>
                   <dive>
                     <!-- here information concerning the second dive  -->
                     <!-- (should show a finite surface interval)  -->
                   </dive>
                   <dive>
                     <!-- here information concerning a third dive  -->
                     <!-- (should show a finite surface interval)  -->
                   </dive>
                 </repgroup>
                 <repgroup>
                     <!-- here more dive profiles follow  -->
                 </repgroup>
                 </profile>






  22..3322..  <<ssaammpplleess>> ...... <<//ssaammpplleess>>   ((pprreessccrriibbeedd))

  Inside <samples> the real profile data are stored (only depth
  statements at constant time interval or time and depth statements,
  respectively, and possibly warnings given by the dive computer). As
  well the presently used breathing gas or gas changes are given here.
  The occurence of the first <``switch''> statement directly after
  <samples> is prescribed.
  <samples> is the last section inside a <``dive''> section.

  Example 1:



                      <!-- more statements -->
                      <!-- profiles generated by dive simulation programs -->
                      <!-- normally use "timedepthmode" and provide time and -->
                      <!-- depth statements -->
                      <timedepthmode/>
                      <samples>
                        <!-- at beginning of dive use breathing gas "1" -->
                        <!-- (defined in the <gases> section) -->
                        <switch>1</switch>
                        <!-- a dive always starts at 0 minutes and at the surface at 0 metre ! -->
                        <t>0.0</t><d>0.0</d>
                        <t>5.0</t><d>40.0</d>
                        <t>15.0</t><d>40.0</d>
                        <t>18.0</t><d>28.0</d>
                        <t>25.0</t>15.0<d></d>
                        <t>31.0</t><d>6.0</d>
                        <!-- switch to breathing gas "2" -->
                        <switch>2</switch>
                        <t>34.0</t><d>3.0</d>
                        <t>38.0</t><d>3.0</d>
                        <!-- a dive always ends at the surface at 0 metre ! -->
                        <t></t><d>0.0</d>
                      </samples>
                    </dive>
                    <!-- here more dives can follow  -->





  Example 2:





























                 <!-- previous statements -->
                 <!-- dive computer do the recordings at a constant time interval -->
                 <!-- and only store the depths, therefore an additional giving -->
                 <!-- of time to each depth can be dropped -->
                 <deltamode/>
                 <samples>
                   <!-- depths recorded with a 20 seconds interval -->
                   <delta>20.0</delta>
                   <!-- use air at beginning of dive  -->
                   <!-- (defined in <gases> section) -->
                   <switch>air</switch>
                   <!-- a dive always starts at 0 minutes and at the surface at 0 metre ! -->
                   <d> 0.0</d>
                   <d> 4.7</d>
                   <d> 7.0</d>
                   <d>11.1</d>
                   <!-- here some more depth statements  -->
                   <d>13.9</d>
                   <d>13.9</d><work>1</work>
                   <d>14.1</d><work>1</work>
                   <d>14.5</d><work>1</work>
                   <d>15.0</d><work>1</work>
                   <d>15.2</d>
                   <d>13.8</d>
                   <d>12.8</d><alarm>ascent</alarm>
                   <d>10.2</d>
                   <d> 9.4</d>
                   <d> 8.1</d>
                   <d> 7.2</d>
                   <d> 6.1</d>
                   <d> 5.3</d>
                   <d> 4.2</d><alarm>breath</alarm>
                   <d> 3.4</d>
                   <d> 3.6</d>
                   <d> 4.1</d>
                   <d> 3.6</d>
                   <d> 2.8</d>
                   <d> 2.7</d>
                   <d> 2.0</d>
                   <d> 1.1</d>
                   <!-- a dive always ends at the surface at 0 metre ! -->
                   <d>0.0</d>
                 </samples>
               </dive>
               <!-- here more dives can follow  -->





  22..3333..  <<sseerriiaalliidd>> ...... <<//sseerriiaalliidd>>   ((ooppttiioonnaall))

  Serial number of the recording dive computer.

  Stands inside the (optional) <``addinfo''> section as last statement
  (if given) after <``totaldives''> (if given).

  Example: see <``addinfo''>



  22..3344..  <<ssuurrffaacceeiinntteerrvvaall>> ...... <<//ssuurrffaacceeiinntteerrvvaall>>   ((pprreessccrriibbeedd))

  The surface interval between two subsequent dives.


  If the following dive is a "repetitive dive" (tissues not yet fully
  desaturated), the surface interval is given in minutes as a real
  number with one digit after the decimal point. When all the tissues
  are desaturated the keyword "infinity" is bracketed by
  <surfaceinterval> instead.

  Stands inside the <``dive''> section after the statements concerning
  place, date, and time, and before <``temperature''>.

  Examplee:



                    <!-- surface interval 36 minutes: -->
                    <surfaceinterval>36.0</surfaceinterval>

                    <!-- tissues fully desaturated -->
                    <surfaceinterval>infinity</surfaceinterval>





  22..3355..  <<sswwiittcchh>> ...... <<//sswwiittcchh>>   ((pprreessccrriibbeedd))

  Indicates the breathing gas used.

  Stands inside the <samples> section before the first depth or
  time/depth statement, respectively. In <``deltamode/''> it's the
  second statement after <``delta''>, in <``timedepthmode/''> it's the
  first statement.

  The statement is effective after the following depth or time/depth
  statement, respectively. It's possible to arbitrarily often change the
  breathing gas used.

  Example: see <``samples''>



  22..3366..  <<tt>> ...... <<//tt>>   ((pprreessccrriibbeedd))

  The absolutely elapsed time since beginning of dive, given in minutes
  (metric or imperial units, respectively) or seconds (SI units).

  Stands inside the <samples> section.

  The first <t> statement must be <t>0.0</t> (in connection with
  <d>0.0</d>).

  Example: see <``samples''>



  22..3377..  <<ttaannkk>> ...... <<//ttaannkk>>   ((ooppttiioonnaall))

  In this section the necessary information to perform a gas consumption
  calculation is given.

  Elements inside <tank> are: <``tankvolume''>, <``pstart''>, and
  <``pend''>.

  <tank> follows directly after <``mixname''> and before the breathing
  gas statements inside the <``mix''> section.


  Example 1:


                    <!-- previous statements -->
                    <mix>
                      <mixname>air</mixname>
                      <tank>
                        <tankvolume>10.0</tankvolume>
                        <pstart>20000000.0</pstart>
                        <!-- because the air consumption volume is given below -->
                        <!-- the information concerning the fill pressure at the -->
                        <!-- end of dive can be dropped here -->
                      </tank>
                      <o2>0.21</o2>
                      <n2>0.79</n2>
                      <he>0.0</he>
                      <acv>20.0</acv>
                    </mix>
                    <!-- more statements -->




  Example 2:


                    <!-- previous statements -->
                    <mix>
                      <!-- the name of the gas used is allowed to be just a digit for example -->
                      <mixname>1</mixname>
                      <tank>
                        <!-- since fill pressures at beginning and end of dive -->
                        <!-- are given the air consumption volume can be calculated -->
                        <!-- without knowing the tankvolume -->
                        <pstart>20000000.0</pstart>
                        <pend>10400000.0</pend>
                      </tank>
                      <o2>0.21</o2>
                      <n2>0.79</n2>
                      <he>0.0</he>
                    </mix>
                    <!-- more statements -->





  22..3388..  <<ttaannkkvvoolluummee>> ...... <<//ttaannkkvvoolluummee>>   ((ooppttiioonnaall))

  The volume of the tank used in litre (SI, metric) or cubic feet
  (imperial), respectively.

  Stands inside the optional <``tank''> section as first statement (if
  given) before <``pstart''>.

  Example: see <tank>


  22..3399..  <<ttaauussiimm>> ...... <<//ttaauussiimm>>   ((ooppttiioonnaall))

  Bracketing of specific information concerning the dive simulation
  program "Tausim".  At time (Tausim v0.99) the following elements are
  used:

  +o  internal parameters for the presentation of a profile

  +o  <pres>, <timeinc>, <depthinc>, <durdep>, <nstatic>, <rls>

  +o  additional information about the decocompression model used

  +o  <decomodel> - at time the only used keyword is "ZH-L16"

  +o  <buehl> - indicates the version used

  +o  ,,3`` - original version

  +o  ,,4`` - version for calculation of diving tables

  +o  ,,5`` - version for use in dive computers

  +o  <tissues> - number of tissues used, normally 16. For each of these
     compartments the saturation pressure at beginning of dive is given
     below.

  +o  <ip> - saturation of a certain tissue at beginning of dive. As many
     <ip> statements do occur as indicated by <tissues>. The first <ip>
     statement gives the saturation of the fastest, the last <ip>
     statement gives the saturation of the slowest compartment. The SI
     unit Pascal is used.

  Stands inside the optional <``program''> section as the only
  statement.

  example:


                 <!-- previous statements -->
                 </gases>
                 <program>
                   <tausim>
                     <pres>4000000.0</pres>
                     <timeinc>5</timeinc>
                     <depthinc>5</depthinc>
                     <durdep>0</durdep>
                     <nstatic>7</nstatic>
                     <rls>50</rls>
                     <decomodel>ZH-L16</decomodel>
                     <buehl>5</buehl>
                     <tissues>16</tissues>
                     <ip>75073.70000</ip>
                     <ip>75073.70000</ip>
                     <ip>75073.70000</ip>
                     <ip>75073.70000</ip>
                     <ip>75073.70000</ip>
                     <ip>75073.70000</ip>
                     <ip>75073.70000</ip>
                     <ip>75073.70000</ip>
                     <ip>75073.70000</ip>
                     <ip>75073.70000</ip>
                     <ip>75073.70000</ip>
                     <ip>75073.70000</ip>
                     <ip>75073.70000</ip>
                     <ip>75073.70000</ip>
                     <ip>75073.70000</ip>
                     <ip>75073.70000</ip>
                   </tausim>
                 </program>
                 <timedepthmode/>
                 <samples>
                 <!-- profile data follow  -->


  22..4400..  <<tteemmppeerraattuurree>> ...... <<//tteemmppeerraattuurree>>   ((ooppttiioonnaall))

  The lowest water temperature during dive, if known. If unknown the
  element <temperature> is dropped.

  Stands inside the <``dive''> section after the <``surfaceinterval''>
  statement and before <``density''>. The temperature is given as a real
  number with one digit after the decimal point.

  Example:


                    <!-- lowest water temperature 12 degrees Celsius -->
                    <temperature>12.0</temperature>




  Alternatively this tag can be used in the samples-section to indicate
  the temperature of the actual sample.


  22..4411..  <<ttiimmee>> ...... <<//ttiimmee>>   ((pprreessccrriibbeedd))

  The time the dive was performed or the profile was generated by a
  program, respectively.

  Elements inside <time> are as follows: <``hour''> and <``minute''>, in
  this prescribed order.

  Stands inside the <``dive''> section after <``date''>.

  Example:


                 <profile udcf="1">
                 <!-- here statements concerning units and manufacturer  -->
                 <repgroup>
                   <dive>
                     <!-- here statements concerning place (if known) and date -->
                     <time><hour>16</hour><minute>21</minute></time>
                     <!-- here more statements -->
                   </dive>
                 <!-- here more statements -->
                 </profile>





  22..4422..  <<ttiimmeeddeepptthhmmooddee//>>   ((pprreessccrriibbeedd))

  Indicates that in the following <``samples''> section time and depth
  statements will follow.

  Stands directly before the <``samples''> section. See also
  <``deltamode''>.

  Opposite to <``deltamode/''> there is no additional statement inside
  the following <``samples''> section concerning the time/depth mode.

  Example:  see <samples>




  22..4433..  <<ttoottaallddiivveess>> ...... <<//ttoottaallddiivveess>>   ((ooppttiioonnaall))

  Total number of dives.

  Stands inside the (optional) <``addinfo''> section after
  <``persinfo''> (if given) and before <``serialid''> (if given).

  Example: see <``addinfo''>



  22..4444..  <<uunniittss>> ...... <<//uunniittss>>   ((pprreessccrriibbeedd))

  Indicates the system of units used. Allowed keywords are "si",
  "metric", or "imperial", respectively.

  First statement after <``profile udcf="1"''>.




       units:        si: pressure [Pa], height [m], temperature [K],
                         density [kg/m^3], time [s]
                 metric: pressure [bar], height [m], temperature [degrees Celsius],
                         density [kg/m^3], time [min]
               imperial: pressure [psi], height [feet], temperature [degrees Fahrenheit],
                         density [ ??? ], time [min]




  Example:


                 <profile udcf="1">
                 <units>metric</units>
                 <!-- here more statements -->
                 </profile>





  22..4455..  <<vveennddoorr>> ...... <<//vveennddoorr>>   ((pprreessccrriibbeedd))

  The manufacturer of the recording dive computer or the generating dive
  simulation program, respectively.

  Stands inside the <``device''> section as first statement before
  <``model''>.

  Example: see <``device''>


  22..4466..  <<vveerrssiioonn>> ...... <<//vveerrssiioonn>>   ((pprreessccrriibbeedd))

  The version number of the recording dive computer or the generating
  dive simulation program, respectively.

  Stands inside the <``device''> section as last statement after
  <``model''>.

  Example: see <``device''>



  22..4477..  <<wwoorrkk>> ...... <<//wwoorrkk>>   ((ooppttiioonnaall))

  Indicates the work load when using air integrated dive computers. At
  the time the following degrees in Datatrak files are recognized: 1, 2,
  and 4.

  Stands inside the <samples> section and after the belonging depth
  statement.

  Example: see 2. example <``samples''>


  22..4488..  <<yyeeaarr>> ...... <<//yyeeaarr>>   ((pprreessccrriibbeedd))

  The year in which the dive was performed or the profile was generated
  by a program, respectively, should be given as a four digit :-)
  integer number.  (integer) erfolgen.

  Stands inside the <``date''> section. The prescribed sequence is
  <year>, <``month''>, and <``day''>.

  Example: see <``date''>


  CC..  AA ggrraammmmaarr ffoorr UUDDCCFF

  Lowercase words (e.g. profile, units_section or mix_list) represent
  non terminals, whereas uppercase words or words enclosed in double
  quotes (e.g. <UNITS>, </UNITS>, "Imperial" or <ALARM>BREATH</ALARM>)
  represent terminals.




  profile -> <PROFILE UDCF = "1">
              units_section
              device_section
              additional_section
              repgroups
             </PROFILE>






  units_section -> <UNITS>
                    unitsymbol
                   </UNITS>






  unitsymbol -> "Metric" | "Imperial"










  device_section -> <DEVICE>
                     <VENDOR>
                      vendorString
                     </VENDOR>
                     <MODEL>
                      modelString
                     </MODEL>
                     <VERSION>
                      versionID
                     </VERSION>
                    </DEVICE>
  vendorString -> String
  modelString -> String
  versionID -> Integer






  additional_section ->  <ADDINFO>
                          personal_desc
                          totalDives_desc
                          IDString_desc
                         </ADDINFO>
                        |
                         Empty






  personal_desc ->  <PERSINFO>
                     String
                    </PERSINFO>
                   |
                    Empty






  totalDives_desc ->  <TOTALDIVES>
                       Integer
                      </TOTALDIVES>
                     |
                      Empty






  IDString_desc ->  <SERIALID>
                     String
                    </SERIALID>
                   |
                    Empty






  repgroups ->   repgroups repgroupdesc
               | repgroupdesc






  repgroupdesc -> <REPGROUP>
                   divelist
                  </REPGROUP>






  divelist ->   divelist dive_desc
              | dive_desc






  dive_desc -> <DIVE>
                place_desc
                date
                time
                surface_interval
                temperature
                density
                alt_info
                gases_section
                prg_data
                samples
               </DIVE>






  place_desc ->  <PLACE>
                  String
                 </PLACE>
                |
                 Empty


















  date -> <DATE>
           <YEAR>
            year_desc
           </YEAR>
           <MONTH>
            month_desc
           </MONTH>
           <DAY>
            day_desc
           </DAY>
          </DATE>
  day_desc -> Integer
  month_desc -> Integer
  year_desc -> Integer






  time -> <TIME>
           <HOUR>
            hour_desc
           </HOUR>
           <MINUTE>
            minute_desc
           </MINUTE>
          </TIME>
  hour_desc ->   Integer
  minute_desc -> Integer






  temperature ->  <TEMPERATURE>
                    temp_desc
                  </TEMPERATURE>
                 |
                  Empty
  temp_desc -> Real






  density -> <DENSITY>
              density_desc
             </DENSITY>
  density_desc -> Real






  alt_info -> <ALTITUDE>
               level
              </ALTITUDE>
  level -> Real




  surface_interval -> <SURFACEINTERVAL>
                       interval_desc
                      </SURFACEINTERVAL>
  interval_desc -> secs | INFINITY
  secs -> Real






  gases_section -> <GASES>
                    mix_list
                   </GASES>






  mix_list ->   mix_desc mix_list
              | mix_desc






  mix_desc -> <MIX>
               <MIXNAME> mixname </MIXNAME>
               tank_info
               <O2> o2_ratio </O2>
               <N2> n2_ratio </N2>
               <HE> he_ratio </HE>
               acv_desc
              </MIX>
  mixname -> String
  n2_ratio -> Real
  o2_ratio -> Real
  he_ratio -> Real






  acv_desc ->  <ACV>
                acv_value
               </ACV>
              |
               Empty
  acv_value -> Real














  tank_info ->  <TANK>
                 tank_volume_info
                 <PSTART>
                  press_in
                 </PSTART>
                 press_end_desc
                </TANK>
               |
                Emtpy






  press_end_desc -> <PEND>
                     press_out
                    </PEND>
                   |
                    Empty






  press_in -> Real
  press_out -> Real






  tank_volume_info ->  <TANKVOLUME>
                        volume
                       </TANKVOLUME>
                      |
                       Empty
  volume -> Real






  prg_data ->  <PRG>
                String
               </PRG>
              |
               Empty






  samples ->  delta_mode_marker
              <SAMPLES>
               delta_marker switch_desc sample_list_delta
              </SAMPLES>
            | timedep_mode_marker
              <SAMPLES>
               switch_desc sample_list_timedepth
              </SAMPLES>

  delta_mode_marker -> DELTAMODE






  timedep_mode_marker -> TIMEDEPTHMODE






  sample_list_delta ->   sampledesc_delta sample_list_delta
                       | sampledesc_delta






  sample_list_timedepth ->   sampledesc_timedepth sample_list_timedepth
                           | sampledesc_timedepth






  sampledesc_delta ->   depth
                      | switch_desc
                      | temperature
                      | markers






  sampledesc_timedepth ->   point
                          | switch_desc
                          | temperature
                          | markers






  delta_marker ->
                  <DELTA>
                   delta
                  </DELTA>






  delta -> Real





  markers ->   <ALARM>SURFACE</ALARM>
             | <ALARM>ASCENT</ALARM>
             | <ALARM>DECO</ALARM>
             | <ALARM>BREATH</ALARM>
             | <ALARM>RBT</ALARM>
             | <ALARM>ERROR</ALARM>
             | workdesc






  depth -> <DEPTH> Real </DEPTH>






  point -> <T>
            Real
           </T>
           <DEPTH>
            Real
           </DEPTH>






  switch_desc -> <SWITCH>
                  changedMix
                 </SWITCH>
  changedMix -> String






  workdesc -> <WORK>
               Real
              </WORK>






  String -> [a-zA-Z0-9\+\-\.@.,:;'=&\!$\~\(\)\*\ ]+






  Real -> ((([0-9]+)|([0-9]*\.[0-9]+)([eE][-+]?[0-9]+)?)|[0-9]+)







  Integer -> -?[0-9]+






  Empty -> Epsilon


























































