USAGE:
          rm2xyz [options]


 PURPOSE:
Converts real arrays to xyz useful for plotting with GMT scripts.
One or two fields can be input (e.g. elevations or currents).
Arrays that can be processed my be created in otemt1 using
Output is formatted as follows (example 1)
1. Boundary part, 2. x-y-z
    0    0 -652.0000 -704.0000 B
  164    0  660.0000 -704.0000 B
    0  177 -652.0000  712.0000 B
  164  177  660.0000  712.0000 B
 -316.0000 -632.0000  1.4221E-01 -2.2283E+01 S   42    9 1
 -308.0000 -632.0000  1.3431E-01 -3.4337E+01 S   43    9 0
 -300.0000 -632.0000  1.3332E-01 -3.4091E+01 S   44    9 1
 -292.0000 -632.0000  3.3170E-01 -5.6135E+01 S   45    9 0
      x         y         U            V    flag  I    J MOD(I+J,2) 1)


1) MOD is printed only if two fields are input. The idea is
that you could exclude every other node when plotting azimuth symbols.

  OPTIONS:

 -cat         - Does not print the array; for investigating
                what's in the real-array file.                     [don't]
                The actual request is for 99999 arrays, which
                shouldn't be a limitation.

 -C  | -S     - Cartesian or stereographic coordinates        [grid-index]

 -gZ | -gM    - grid type Z or M

 -d$dir       - input file directory (a trailing `/ยด will be added)
  [./]

 -r#min,#max  - output only within specified range.

 -t$target    - include node types                                 [AaOoS]

 -fz $file    - flag file Z                                      [FLZ.DAT]

 -fm $file    - flag file M                                             []

 -fh $file    - flag file M + bathymetry                                []

 -fr $file    - the real-array file                                     []

 -o $file     - output to named file                              [STDOUT]
                If STDOUT you'll need to  pipe it  | fgrep -v '>'

 -I#pos[,#nf] - read the #pos'th array on the file
                and #nf (0, 1 or 2) arrays                           [1,1]
                To only process the depth array, specify -I0,0

 -N#nv[,#nf]  - advance to the array with version nr. #nv          [don't]
                and read the next #nf arrays                           [1]
    
 -P$opt       - conversion options
                /H      - divide by bathymetry (mass transp. to current)
                +R      - convert currents components from SE,NE to E,N
                +A      - convert to amplitude and azimuth
                =H      - copy the bathymetry, negative values
                =D      - like =H , positive values on (see example (3))

EXAMPLES:

 (1)
   rm2xyz -C -fz BALTIC/FLZ.DAT -fh BALTIC/FLMH.DAT -fr fort.92 -tS -gM -I1,2 -P/H
 
prints currents


 
(2)
   rm2xyz -fz BALTIC/FLZ.DAT -fr fort.91 -tS -gZ
  prints elevations
    0    0    0.0000    0.0000 B
  163    0  163.0000    0.0000 B
    0  176    0.0000  176.0000 B
  163  176  163.0000  176.0000 B
   45.5000    7.5000  1.2565E-01 S   45    7

   39.5000    8.5000  4.2855E-01 S   39    8
   41.5000    8.5000 -6.7591E-02 S   41    8
   42.5000    8.5000 -8.6639E-02 S   42    8
   43.5000    8.5000 -1.9532E-01 S   43    8
   44.5000    8.5000 -1.1761E-01 S   44    8


 (3)
   rm2xyz -fz BALTIC/FLZ.DAT -fh BALTIC/FLMH.DAT -tS -gM -I0,0 -P=D 

  prints depth
    0    0 -652.0000 -704.0000 B
  164    0  660.0000 -704.0000 B
    0  177 -652.0000  712.0000 B
  164  177  660.0000  712.0000 B
 -316.0000 -632.0000  1.2000E+01 S   42    9
 -308.0000 -632.0000  1.2000E+01 S   43    9
 -300.0000 -632.0000  1.2343E+01 S   44    9
 -292.0000 -632.0000  1.0001E+01 S   45    9

 (4)

   rm2xyz -d BALTIC -fz FLZ.DAT -fr el-fo.dat -N89320,1 
 
prints the array after(!) the one with version number 89320

 (5)
   rm2xyz
-cat -fr BALTIC/el-fo.dat [-I10] 
  does not print the array. The protocol shows the available arrays.
  (Note the defaults exploited here.)
  With -I10, shows the first 10 arrays. For every array, the messages are
 <GETSIZ>>>   6257     1 array on file unit 22
 <GETRM->>> REAL array, grid M, f.unit 22: ./BALTIC/el-fo.dat  #  24240
 <UnpacR>>> REAL array   6257 ->   163  176. Underrun =      0
 <PGetrm>>> Version #  24240